and_then overloads
Synopses
Declared in <bslstl_optional.h>
If this object contains a value, invoke the specified func with the contained value as an argument and return the result of that invocation; otherwise, return an empty optional. Note that func must return a specialization of bsl::optional. Also note that the return type of func does not have to be this object type. Also note that the optional object returned by func is returned as‐is, without copying or moving. Finally note that the default allocator is used for constructing the empty optional when func is not invoked.
template<class t_FUNC>
constexpr
auto
and_then(t_FUNC&& func) &;
Invoke the specified func on the contained value and return its optional result as a const lvalue.
template<class t_FUNC>
constexpr
auto
and_then(t_FUNC&& func) const &;
Invoke the specified func on the contained value and return its optional result as an rvalue.
template<class t_FUNC>
constexpr
auto
and_then(t_FUNC&& func) &&;
Invoke the specified func on the contained value and return its optional result as a const rvalue.
template<class t_FUNC>
constexpr
auto
and_then(t_FUNC&& func) const &&;
Created with MrDocs