Clingo
Loading...
Searching...
No Matches
Optional Values

Data structures and algorithms around optional values. More...

Classes

struct  CppClingo::Util::ResultState< E, S >
 The result of a simplification. More...
 
class  CppClingo::Util::ResultVec< T, UseSpan >
 Helper to update a vector of elements. More...
 

Functions

template<class T , class F >
constexpr auto CppClingo::Util::transform (std::optional< T > &x, F &&f) -> Detail::transform_result< T &, F >
 Implemenatation of std::optional<T>::transform.
 
template<class T , class F >
constexpr auto CppClingo::Util::transform (std::optional< T > const &x, F &&f) -> Detail::transform_result< T const &, F >
 Implemenatation of std::optional<T>::transform.
 
template<class T , class F >
constexpr auto CppClingo::Util::transform (std::optional< T > &&x, F &&f) -> Detail::transform_result< T, F >
 Map the value in the optional with the given predicate.
 
template<class T , class F >
constexpr auto CppClingo::Util::transform (std::optional< T > const &&x, F &&f) -> Detail::transform_result< T const, F >
 Implemenatation of std::optional<T>::transform.
 
template<class T , class F >
constexpr auto CppClingo::Util::and_then (std::optional< T > &x, F &&f) -> Detail::and_then_result< T &, F >
 Implemenatation of std::optional<T>::and_then.
 
template<class T , class F >
constexpr auto CppClingo::Util::and_then (std::optional< T > const &x, F &&f) -> Detail::and_then_result< T const &, F >
 Implemenatation of std::optional<T>::and_then.
 
template<class T , class F >
constexpr auto CppClingo::Util::and_then (std::optional< T > &&x, F &&f) -> Detail::and_then_result< T, F >
 Implemenatation of std::optional<T>::and_then.
 
template<class T , class F >
constexpr auto CppClingo::Util::and_then (std::optional< T > const &&x, F &&f) -> Detail::and_then_result< T const, F >
 Implemenatation of std::optional<T>::and_then.
 
template<class T , class F >
auto CppClingo::Util::transform_vec (std::optional< std::vector< T > > const &vec, F const &f) -> Detail::transform_vec_result< T const &, F const & >
 Map the given predicate over an optional vector.
 
template<class T , class F >
auto CppClingo::Util::transform_vec (std::optional< std::vector< T > > &&vec, F const &f) -> Detail::transform_vec_result< T, F const & >
 Map the given predicate over an optional vector.
 
template<class T >
 CppClingo::Util::ResultVec (std::vector< T > const &) -> ResultVec< T, true >
 Deduction guide to construct from a std::vector.
 
template<class T >
 CppClingo::Util::ResultVec (std::span< T const > const &) -> ResultVec< T, true >
 Deduction guide to construct from a std::span.
 
template<class T >
 CppClingo::Util::ResultVec (immutable_array< T > const &) -> ResultVec< T, false >
 Deduction guide to construct from an immutable array.
 

Detailed Description

Data structures and algorithms around optional values.

Function Documentation

◆ transform()

template<class T , class F >
constexpr auto CppClingo::Util::transform ( std::optional< T > &&  x,
F &&  f 
) -> Detail::transform_result<T, F>
constexpr

Map the value in the optional with the given predicate.

Implemenatation of std::optional<T>::transform.