beman::optional::optional<T&>::transform

Applies a function to the contained value if there is one.

Synopsis

Declared in <beman/optional/optional.hpp>
template<class F>
constexpr
optional<std::invoke_result_t<F, T&>>
transform(F&& f) const;

Description

The return type is the same as std::invoke_result_t<F, T&>, but wrapped in an optional.

Return Value

optional<std::invoke_result_t<F, T&>>

Template Parameters

Name Description
F The type of the invocable

Parameters

Name Description
f The invocable to apply to the contained value

Created with MrDocs