bsl::make_optional

make_optional overloads

Synopses

Declared in <bslstl_optional.h>

Return an optional object containing a value-initialized t_TYPE object.

template<class t_TYPE>
constexpr
bsl::optional<t_TYPE>
make_optional();
» more...

Return an optional containing a value constructed from the arguments.

template<class t_TYPE>
constexpr
bsl::optional<bsl::decay<t_TYPE>::type>
make_optional(t_TYPE&& rhs);
» more...

Return an optional containing a value constructed from the arguments.

template<
    class t_TYPE,
    class t_INIT_LIST_TYPE,
    class... t_ARGS>
constexpr
bsl::optional<t_TYPE>
make_optional(
    std::initializer_list<t_INIT_LIST_TYPE> il,
    t_ARGS&&... args);
» more...

Return an optional containing a value constructed from the arguments.

template<
    class t_TYPE,
    class t_ARG,
    class... t_ARGS>
constexpr
optional<t_TYPE>
make_optional(
    t_ARG&& arg,
    t_ARGS&&... args);
» more...

Return an optional containing a value constructed from the arguments.

template<class t_TYPE>
bsl::optional<bsl::decay<t_TYPE>::type>
make_optional(
    std::allocator_arg_t allocatorArg,
    bsl::optional<bsl::decay<t_TYPE>::type>::allocator_type const& alloc,
    t_TYPE&& rhs);
» more...

Return an optional containing a value constructed from the arguments.

template<
    class t_TYPE,
    class... t_ARGS>
bsl::optional<t_TYPE>
make_optional(
    std::allocator_arg_t allocatorArg,
    bsl::optional<t_TYPE>::allocator_type const& alloc,
    t_ARGS&&... args);
» more...

Return an optional containing a value constructed from the arguments.

template<
    class t_TYPE,
    class t_INIT_LIST_TYPE,
    class... t_ARGS>
bsl::optional<t_TYPE>
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);
» 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

NameDescription
rhsright-hand operand
ilinitializer list forwarded to construct the contained value
argsarguments forwarded to construct the contained value
argargument forwarded to construct the contained value
allocatorArgtag selecting the allocator-extended constructor
allocallocator used to supply memory for the optional