Creates an optional holding a decayed copy of the given value.
Synopsis
Declared in <beman/optional/optional.hpp>
template<
int = 0,
class T>
constexpr
optional<std::decay_t<T>>
make_optional(T&& t) noexcept(/* see-below */)
requires std::is_constructible_v<std::decay_t<T>, T>;
Exception specification
This function is potentially-throwing unless std::is_nothrow_constructible_v<optional<std::decay_t<T>>, T>.
Return Value
An engaged optional whose contained value is constructed from t.
Parameters
Name |
Description |
t |
The value to store in the returned optional. |
Created with MrDocs