transform 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 optional<U> that contains the result of that invocation, where U is the cv‐unqualified func return type, which can be different from t_TYPE; otherwise, return an empty optional<U>. Note that func must return an object type other than array, bsl::in_place_t or bsl::nullopt. Also note that there is no requirement that U is movable. Finally note that the returned optional uses the allocator of the object returned by func, or the default allocator if func is not invoked.
template<class t_FUNC>
constexpr
auto
transform(t_FUNC&& func) &;
Same as the transform overload taking &.
template<class t_FUNC>
constexpr
auto
transform(t_FUNC&& func) const &;
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) &&;
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 &&;
Created with MrDocs