[#beman-optional-make_optional-02] = xref:beman.adoc[beman]::xref:beman/optional.adoc[optional]::make_optional :relfileprefix: ../../ :mrdocs: `make_optional` overloads == Synopses Declared in `<beman/optional/optional.hpp>` Creates an optional holding a decayed copy of the given value. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< int = 0, class T> constexpr xref:beman/optional/optional-03.adoc[optional<std::decay_t<T>>] xref:beman/optional/make_optional-05.adoc[make_optional](T&& t) noexcept(/* see-below */) requires std::is_constructible_v<std::decay_t<T>, T>; ---- [.small]#xref:beman/optional/make_optional-05.adoc[_» more..._]# Creates an optional<T> constructing the value in‐place from the given arguments. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename T, typename... Args> constexpr xref:beman/optional/optional-03.adoc[optional<T>] xref:beman/optional/make_optional-00.adoc[make_optional](Args&&... args) noexcept(/* see-below */) requires std::is_constructible_v<T, Args...>; ---- [.small]#xref:beman/optional/make_optional-00.adoc[_» more..._]# Creates an optional<T> constructing the value in‐place from an initializer list and arguments. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename T, typename U, typename... Args> constexpr xref:beman/optional/optional-03.adoc[optional<T>] xref:beman/optional/make_optional-0f.adoc[make_optional]( std::initializer_list<U> il, Args&&... args) noexcept(/* see-below */) requires std::is_constructible_v<T, std::initializer_list<U>&, Args...>; ---- [.small]#xref:beman/optional/make_optional-0f.adoc[_» more..._]# == Return Value * An engaged optional whose contained value is constructed from `t.` * An engaged optional<T> holding the in‐place constructed value. == Parameters [cols="1,4"] |=== | Name| Description | *t* | The value to store in the returned optional. | *args* | The arguments forwarded to the constructor of `T.` | *il* | The initializer list forwarded to the constructor of `T.` |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#