|
gimo v0.1.0
|
Classes | |
| class | BasicAlgorithm |
| The basic building block for every monadic operation. More... | |
| class | Pipeline |
| A composite object representing a sequence of monadic operations. More... | |
| struct | traits |
| The central customization point for the library. More... | |
| struct | traits< std::expected< Value, Error > > |
| struct | traits< std::optional< T > > |
| struct | traits< std::shared_ptr< T > > |
| struct | traits< std::unique_ptr< T, Deleter > > |
| struct | traits< T * > |
Concepts | |
| concept | applicable_to |
Evaluates whether a Nullable type is compatible with the specific Algorithm. | |
| concept | null_for |
| Concept describing the relationship between a Nullable type and its null state. | |
| concept | nullable |
| Concept describing a type that can be used as a monad in the pipeline. | |
| concept | constructible_from_value |
Concept determining whether the Nullable is constructible with the specified argument. | |
| concept | rebindable_value_to |
Concept determining whether the Nullable type supports rebinding its value-type. | |
| concept | expected_like |
Concept describing a type that acts like std::expected (has both a value and an error channel). | |
| concept | constructible_from_error |
Concept determining whether the Expected type supports rebinding its error-type. | |
| concept | rebindable_error_to |
Concept determining whether the Expected type supports rebinding its error-type. | |
| concept | pipeline |
Checks whether the given type is a specialization of gimo::Pipeline. | |
| concept | processable_by |
Evaluates whether a Nullable type can be processed by the entire pipeline. | |
Typedefs | |
| template<nullable Nullable, typename Value> | |
| using | rebind_value_t = typename traits<std::remove_cvref_t<Nullable>>::template rebind_value<Value> |
Helper alias to obtain the Nullable type with the rebound Value type. | |
| template<expected_like Expected, typename Error> | |
| using | rebind_error_t = typename traits<std::remove_cvref_t<Expected>>::template rebind_error<std::remove_cvref_t<Error>> |
Helper alias to obtain the Expected type with the rebound Error type. | |
Functions | |
| template<typename Action> | |
| constexpr auto | and_then (Action &&action) |
| Creates a pipeline step that applies a function returning a nullable type. | |
| template<typename Action> | |
| constexpr auto | or_else (Action &&action) |
| Creates a pipeline step that handles the null/error case. | |
| template<typename Action> | |
| constexpr auto | transform (Action &&action) |
| Creates a pipeline step that transforms the underlying value. | |
| template<typename Action> | |
| constexpr auto | transform_error (Action &&action) |
| Creates a pipeline step that transforms the error of an expected-like type. | |
| template<nullable Nullable, typename Arg> requires constructible_from_value<Nullable, Arg&&> | |
| constexpr Nullable | construct_from_value (Arg &&arg) noexcept(detail::nothrow_constructible_from_value< Nullable, Arg && >) |
Constructs the specified Nullable with the provided value. | |
| template<nullable Nullable, pipeline Pipeline> | |
| constexpr auto | apply (Nullable &&opt, Pipeline &&steps) |
| Applies nullable input on the pipeline. | |
Variables | |
| template<nullable Nullable> | |
| constexpr auto | null_v {traits<std::remove_cvref_t<Nullable>>::null} |
Helper to obtain the null value for a specific Nullable type. | |
| using gimo::rebind_error_t = typename traits<std::remove_cvref_t<Expected>>::template rebind_error<std::remove_cvref_t<Error>> |
Helper alias to obtain the Expected type with the rebound Error type.
| Expected | The source-expected type to adapt the new error-type. |
| Error | The new error-type to rebind to. |
| using gimo::rebind_value_t = typename traits<std::remove_cvref_t<Nullable>>::template rebind_value<Value> |
Helper alias to obtain the Nullable type with the rebound Value type.
| Nullable | The source-nullable type to adapt the new value-type. |
| Value | The new value-type to rebind to. |
|
constexprnoexcept |
Constructs the specified Nullable with the provided value.
| Nullable | The target-nullable type. |
| Arg | The construction argument type to forward. |
| arg | The argument forwarded to the actual construction strategy. |
Nullable instance in a non-null state. The construction strategy is selected based on the following precedence:
gimo::traits<Nullable>::from_value
|
inlineconstexpr |
Helper to obtain the null value for a specific Nullable type.
| Nullable | The type for which to retrieve the null value. |