[#beman-optional-make_optional-05] = xref:beman.adoc[beman]::xref:beman/optional.adoc[optional]::make_optional :relfileprefix: ../../ :mrdocs: Creates an optional holding a decayed copy of the given value. == Synopsis Declared in `<beman/optional/optional.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< int = 0, class T> constexpr xref:beman/optional/optional-03.adoc[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 [cols="1,4"] |=== | Name| Description | *t* | The value to store in the returned optional. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#