bsl::optional::transform

transform overloads

Synopses

Declared in <bslstl_optional.h>

Map the contained value through func, or return an empty optional.

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

Same as the transform overload taking &.

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

Apply the specified func to the contained value and return the result as an rvalue optional.

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

Apply the specified func to the contained value and return the result as a const rvalue optional.

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

Return Value

optional containing the result of func, or empty if disengaged

Parameters

NameDescription
funccallable invoked with the contained value or when empty