|
| template<typename... Args> |
| | Either (Args &&... args) |
| |
| const T & | value_or_throw () const & |
| | Get the value of the Either if it has a value, otherwise throw an exception using the error value if applicable, or a default message.
|
| |
| T & | value_or_throw () & |
| | Get the value of the Either if it has a value, otherwise throw an exception using the error value if applicable, or a default message.
|
| |
| T && | value_or_throw () && |
| | Get the value of the Either if it has a value, otherwise throw an exception using the error value if applicable, or a default message.
|
| |
| const T & | value_or_throw (const std::string &errorMsg) const & |
| | Get the value of the Either if it has a value, otherwise throw an exception with the provided message.
|
| |
| T & | value_or_throw (const std::string &errorMsg) & |
| | Get the value of the Either if it has a value, otherwise throw an exception with the provided message.
|
| |
| T && | value_or_throw (const std::string &errorMsg) && |
| | Get the value of the Either if it has a value, otherwise throw an exception with the provided message.
|
| |
template<typename F >
requires fishnet::util::UnaryFunction<F,T,Either<typename std::remove_cvref_t<std::invoke_result_t<F,T>>::value_type,E>> |
| Either< typename std::remove_cvref_t< std::invoke_result_t< F, T > >::value_type, E > | and_then (F &&f) & |
| | flatMap the value of the Either if it has a value, otherwise return the error
|
| |
template<typename F >
requires fishnet::util::UnaryFunction<F,T,Either<typename std::remove_cvref_t<std::invoke_result_t<F,T>>::value_type,E>> |
| Either< typename std::remove_cvref_t< std::invoke_result_t< F, T > >::value_type, E > | and_then (F &&f) && |
| | flatMap the value of the Either if it has a value, otherwise return the error
|
| |
template<typename F >
requires fishnet::util::UnaryFunction<F,T, typename std::remove_cvref_t<std::invoke_result_t<F,T>>> |
| Either< typename std::remove_cvref_t< std::invoke_result_t< F, T > >, E > | transform (F &&f) & |
| | Transform the value of the Either if it has a value, otherwise return the error.
|
| |
template<typename F >
requires fishnet::util::UnaryFunction<F,T, typename std::remove_cvref_t<std::invoke_result_t<F,T>>> |
| Either< typename std::remove_cvref_t< std::invoke_result_t< F, T > >, E > | transform (F &&f) && |
| | Transform the value of the Either if it has a value, otherwise return the error.
|
| |
template<typename F >
requires std::convertible_to<std::invoke_result_t<F>,Either<T,E>> |
| Either< T, E > | or_else (F &&f) & |
| | If the Either has a value, return it. Otherwise, call the provided function and return its result.
|
| |
template<typename F >
requires std::convertible_to<std::invoke_result_t<F>,Either<T,E>> |
| Either< T, E > | or_else (F &&f) && |
| | If the Either has a value, return it. Otherwise, call the provided function and return its result.
|
| |
| void | if_value (fishnet::util::Consumer< T > auto const &consumer) |
| | If the Either has a value, call the provided function with the value. Otherwise, do nothing.
|
| |
| void | if_value_or_error (fishnet::util::Consumer< T > auto const &consumer, fishnet::util::Consumer< E > auto const &errorConsumer) |
| | If the Either has a value, call the provided function with the value. Otherwise, call the provided function with the error.
|
| |