Constructors

Synopses

Declared in <bslstl_optional.h>

Create a disengaged Optional_Base object.

constexpr
Optional_Base();

Create a disengaged Optional_Base object.

These allocator‐extended constructors cannot be called, and are provided only to prevent compilation errors when 'optional' is explicitly instantiated.

Optional_Base(
    std::allocator_arg_t,
    AllocType);

Create an Optional_Base object whose contained value is initialized by forwarding from the specified value.

template<class t_ANY_TYPE>
constexpr
Optional_Base(
    BloombergLP::bslstl::Optional_ConstructFromForwardRef,
    t_ANY_TYPE&& value);

Create a disengaged Optional_Base object if the specified original object is disengaged, and an Optional_Base object with the value of original.value() (of t_ANY_TYPE) converted to t_TYPE otherwise.

template<class t_ANY_TYPE>
constexpr
Optional_Base(
    BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
    std::optional<t_ANY_TYPE> const& original);

Create a disengaged Optional_Base object if the specified original object is disengaged, and an Optional_Base object with the value of original.value() (of t_ANY_TYPE) converted to t_TYPE otherwise. original is left in a valid but unspecified state.

template<class t_ANY_TYPE>
constexpr
Optional_Base(
    BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
    std::optional<t_ANY_TYPE>&& original);

Create an Optional_Base object whose contained value is initialized from the specified args.

template<class... t_ARGS>
constexpr
explicit
Optional_Base(
    std::in_place_t,
    t_ARGS&&... args);
Optional_Base(
    std::allocator_arg_t,
    AllocType,
    bsl::nullopt_t);

Create an Optional_Base object, which contains the result of invocation of the specified invocable with the specified arg.

template<
    class t_INVOCABLE,
    class t_ARG>
Optional_Base(
    Optional_InvokeConstructorTag,
    t_INVOCABLE&& invocable,
    t_ARG&& arg);

Create an Optional_Base object whose contained value is initialized from the specified il and args.

template<
    class t_INIT_LIST_TYPE,
    class... t_ARGS>
constexpr
Optional_Base(
    std::in_place_t,
    std::initializer_list<t_INIT_LIST_TYPE> il,
    t_ARGS&&... args);
template<class t_ANY_TYPE>
Optional_Base(
    std::allocator_arg_t,
    AllocType,
    BloombergLP::bslstl::Optional_ConstructFromForwardRef,
    t_ANY_TYPE&&);
template<class t_ANY_TYPE>
Optional_Base(
    std::allocator_arg_t,
    AllocType,
    BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
    std::optional<t_ANY_TYPE> const&);
template<class t_ANY_TYPE>
Optional_Base(
    std::allocator_arg_t,
    AllocType,
    BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
    std::optional<t_ANY_TYPE>&&);
template<class... t_ARGS>
Optional_Base(
    std::allocator_arg_t,
    AllocType,
    std::in_place_t,
    t_ARGS&&...);
template<
    class t_INIT_LIST_TYPE,
    class... t_ARGS>
Optional_Base(
    std::allocator_arg_t,
    AllocType,
    std::in_place_t,
    std::initializer_list<t_INIT_LIST_TYPE>,
    t_ARGS&&...);

Created with MrDocs