bsl::optional::and_then

and_then overloads

Synopses

Declared in <bslstl_optional.h>

Invoke func on the contained value, or return an empty optional.

template<class t_FUNC>
constexpr
auto
and_then(t_FUNC&& func) &;
» more...

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 &;
» more...

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) &&;
» more...

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 &&;
» more...

Return Value

result of func if engaged, otherwise an empty optional

Parameters

NameDescription
funccallable invoked with the contained value or when empty