|
| template<typename... Args> |
| | Option (Args &&... args) |
| |
| const T & | value_or_throw (const std::string &message="No value present!") const & |
| | Get the value of the Option if it has a value, otherwise throw an exception with the provided message.
|
| |
| T && | value_or_throw (const std::string &message="No value present!") && |
| | Get the value of the Option if it has a value, otherwise throw an exception with the provided message.
|
| |
template<typename F >
requires fishnet::util::UnaryFunction<F,T,Option<typename std::remove_cvref_t<std::invoke_result_t<F,T>>::value_type>> |
| Option< typename std::remove_cvref_t< std::invoke_result_t< F, T > >::value_type > | and_then (F &&f) const & |
| | FlatMap the value of the Option if it has a value, otherwise return an empty Option.
|
| |
template<typename F >
requires fishnet::util::UnaryFunction<F,T,Option<typename std::remove_cvref_t<std::invoke_result_t<F,T>>::value_type>> |
| Option< typename std::remove_cvref_t< std::invoke_result_t< F, T > >::value_type > | and_then (F &&f) && |
| | FlatMap the value of the Option if it has a value, otherwise return an empty Option.
|
| |
template<typename F >
requires fishnet::util::UnaryFunction<F,T,typename std::remove_cvref_t<std::invoke_result_t<F,T>>> |
| Option< typename std::remove_cvref_t< std::invoke_result_t< F, T > > > | transform (F &&f) const & |
| | Transform the value of the Option if it has a value, otherwise return an empty Option.
|
| |
template<typename F >
requires fishnet::util::UnaryFunction<F,T,typename std::remove_cvref_t<std::invoke_result_t<F,T>>> |
| Option< typename std::remove_cvref_t< std::invoke_result_t< F, T > > > | transform (F &&f) && |
| | Transform the value of the Option if it has a value, otherwise return an empty Option.
|
| |
template<typename F >
requires std::convertible_to<std::invoke_result_t<F>,T> |
| Option< T > | or_else (F &&f) const & |
| | If the Option 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>,Option<T>> |
| Option< T > | or_else (F &&f) && |
| | If the Option has a value, return it. Otherwise, call the provided function and return its result.
|
| |
| Option< T > | filter (fishnet::util::Predicate< T > auto const &predicate) |
| | If the Option has a value and the predicate returns true, return the Option. Otherwise, return an empty Option.
|
| |
| void | if_value (fishnet::util::Consumer< T > auto const &consumer) |
| | If the Option has a value, call the provided function with the value. Otherwise, do nothing.
|
| |
| void | if_value_or_else (fishnet::util::Consumer< T > auto const &consumer, fishnet::util::Runnable auto const &runnable) |
| | If the Option has a value, call the provided function with the value. Otherwise, call the provided function.
|
| |