[#bsl-make_optional-0c] = xref:bsl.adoc[bsl]::make_optional :relfileprefix: ../ :mrdocs: `make_optional` overloads == Synopses Declared in `<bslstl_optional.h>` Return an `optional` object containing a value‐initialized `t_TYPE` object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> constexpr xref:bsl/optional-072.adoc[bsl::optional<t_TYPE>] xref:bsl/make_optional-01.adoc[make_optional](); ---- [.small]#xref:bsl/make_optional-01.adoc[_» more..._]# Return an `optional` containing a value constructed from the arguments. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> constexpr xref:bsl/optional-072.adoc[bsl::optional<bsl::decay<t_TYPE>::type>] xref:bsl/make_optional-0a.adoc[make_optional](t_TYPE&& rhs); ---- [.small]#xref:bsl/make_optional-0a.adoc[_» more..._]# Return an `optional` containing a value constructed from the arguments. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, class t_INIT_LIST_TYPE, class... t_ARGS> constexpr xref:bsl/optional-072.adoc[bsl::optional<t_TYPE>] xref:bsl/make_optional-03.adoc[make_optional]( std::initializer_list<t_INIT_LIST_TYPE> il, t_ARGS&&... args); ---- [.small]#xref:bsl/make_optional-03.adoc[_» more..._]# Return an `optional` containing a value constructed from the arguments. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, class t_ARG, class... t_ARGS> constexpr xref:bsl/optional-072.adoc[optional<t_TYPE>] xref:bsl/make_optional-00.adoc[make_optional]( t_ARG&& arg, t_ARGS&&... args); ---- [.small]#xref:bsl/make_optional-00.adoc[_» more..._]# Return an `optional` containing a value constructed from the arguments. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> xref:bsl/optional-072.adoc[bsl::optional<bsl::decay<t_TYPE>::type>] xref:bsl/make_optional-04.adoc[make_optional]( std::allocator_arg_t allocatorArg, bsl::optional<bsl::decay<t_TYPE>::type>::allocator_type const& alloc, t_TYPE&& rhs); ---- [.small]#xref:bsl/make_optional-04.adoc[_» more..._]# Return an `optional` containing a value constructed from the arguments. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, class... t_ARGS> xref:bsl/optional-072.adoc[bsl::optional<t_TYPE>] xref:bsl/make_optional-0e.adoc[make_optional]( std::allocator_arg_t allocatorArg, bsl::optional<t_TYPE>::allocator_type const& alloc, t_ARGS&&... args); ---- [.small]#xref:bsl/make_optional-0e.adoc[_» more..._]# Return an `optional` containing a value constructed from the arguments. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_TYPE, class t_INIT_LIST_TYPE, class... t_ARGS> xref:bsl/optional-072.adoc[bsl::optional<t_TYPE>] xref:bsl/make_optional-06.adoc[make_optional]( std::allocator_arg_t allocatorArg, bsl::optional<t_TYPE>::allocator_type const& alloc, std::initializer_list<t_INIT_LIST_TYPE> il, t_ARGS&&... args); ---- [.small]#xref:bsl/make_optional-06.adoc[_» more..._]# == Return Value * `optional` containing a value‐initialized `t_TYPE` * `optional` containing a `t_TYPE` constructed from `rhs` * `optional` containing a `t_TYPE` constructed from `il` and `args` * `optional` containing a `t_TYPE` constructed from the arguments * `optional` containing a `t_TYPE` constructed from `args` == Parameters [cols="1,4"] |=== | Name| Description | *rhs* | right‐hand operand | *il* | initializer list forwarded to construct the contained value | *args* | arguments forwarded to construct the contained value | *arg* | argument forwarded to construct the contained value | *allocatorArg* | tag selecting the allocator‐extended constructor | *alloc* | allocator used to supply memory for the optional |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#