Constructors

Synopses

Declared in <bslstl_optional.h>

Create a disengaged Optional_Base object. Use the currently installed default allocator to supply memory.

Create an Optional_Base object having the value of the specified original object. Use the currently installed default allocator to supply memory.

Optional_Base(Optional_Base const& original);

Create a disengaged Optional_Base object. Use the currently installed default allocator to supply memory.

Create an Optional_Base object having the same value as the specified original object by moving the contents of original to the newly‐created object. The allocator associated with original is propagated for use in the newly‐created object. original is left in a valid, but unspecified state.

Optional_Base(BloombergLP::bslmf::MovableRef<Optional_Base> original) noexcept(/* see-below */);

Create a disengaged Optional_Base object. Use the specified allocator to supply memory.

Optional_Base(
    std::allocator_arg_t,
    allocator_type allocator);

Create an Optional_Base object whose contained value is initialized by forwarding from the specified value. Use the currently installed default allocator to supply memory.

template<class t_ANY_TYPE>
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() converted to t_TYPE otherwise. Use the currently installed default allocator to supply memory.

Create a disengaged Optional_Base object if the specified original object is disengaged, and an Optional_Base object with the value of original.value() converted to t_TYPE otherwise. Use the currently installed default allocator to supply memory.

template<class t_ANY_TYPE>
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() converted to t_TYPE otherwise. Use the currently installed default allocator to supply memory. original is left in a valid but unspecified state.

Create a disengaged Optional_Base object if the specified original object is disengaged, and an Optional_Base object with the value of original.value() otherwise. This is a special case constructor where t_ANY_TYPE is a non‐const version of t_TYPE and we use the allocator from original to supply memory. original is left in a valid but unspecified state.

Create a disengaged Optional_Base object if the specified original object is disengaged, and an Optional_Base object with the value of original.value() converted to t_TYPE otherwise. Use the currently installed default allocator to supply memory.

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

Create an Optional_Base object having the value of the (template parameter) t_TYPE created in place using the specified args. Use the currently installed default allocator to supply memory.

template<class... t_ARGS>
explicit
Optional_Base(
    std::in_place_t,
    t_ARGS&&... args);

Create a disengaged Optional_Base object. Use the specified allocator to supply memory.

Optional_Base(
    std::allocator_arg_t,
    allocator_type allocator,
    bsl::nullopt_t);

If the specified original contains a value, create an Optional_Base object whose contained value is initialized by moving *original. Otherwise, create a disengaged Optional_Base object. Use the specified allocator to supply memory. original is left in a valid but unspecified state.

Optional_Base(
    std::allocator_arg_t,
    allocator_type allocator,
    BloombergLP::bslmf::MovableRef<Optional_Base> original);

If the specified original contains a value, create an Optional_Base object whose contained value is initialized from *original. Otherwise, create a disengaged Optional_Base object. Use the specified allocator to supply memory.

Optional_Base(
    std::allocator_arg_t,
    allocator_type allocator,
    Optional_Base const& original);

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 tag,
    t_INVOCABLE&& invocable,
    t_ARG&& arg);

Create an Optional_Base object having the value of the (template parameter) t_TYPE created in place using the specified il and specified args. Use the currently installed default allocator to supply memory.

template<
    class t_INIT_LIST_TYPE,
    class... t_ARGS>
Optional_Base(
    std::in_place_t,
    std::initializer_list<t_INIT_LIST_TYPE> il,
    t_ARGS&&... args);

Create an Optional_Base object whose contained value is initialized by forwarding from the specified value. Use the specified allocator to supply memory.

template<class t_ANY_TYPE>
Optional_Base(
    std::allocator_arg_t,
    allocator_type allocator,
    BloombergLP::bslstl::Optional_ConstructFromForwardRef,
    t_ANY_TYPE&& value);

If the specified original contains a value, create an Optional_Base object whose contained value is initialized from *original, converted to t_TYPE. Otherwise, create a disengaged Optional_Base. Use the specified allocator to supply memory.

template<class t_ANY_TYPE>
Optional_Base(
    std::allocator_arg_t,
    allocator_type allocator,
    BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
    Optional_Base<t_ANY_TYPE> const& original);

If the specified original contains a value, create an Optional_Base object whose contained value is initialized from *original, converted to t_TYPE. Otherwise, create a disengaged Optional_Base object. Use the specified allocator to supply memory.

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

If the specified original contains a value, create an Optional_Base object whose contained value is initialized by moving from *original and converting to t_TYPE. Otherwise, create a disengaged Optional_Base. Use the specified allocator to supply memory. original is left in a valid but unspecified state.

If the specified original contains a value, create an Optional_Base object whose contained value is initialized from moving from *original and converting to t_TYPE. Otherwise, create a disengaged Optional_Base. Use the specified allocator to supply memory. original is left in a valid but unspecified state.

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

Create an Optional_Base object whose contained value is initialized from the specified args. Use the specified allocator to supply memory.

template<class... t_ARGS>
Optional_Base(
    std::allocator_arg_t,
    allocator_type allocator,
    std::in_place_t,
    t_ARGS&&... args);

Create an Optional_Base object whose contained value is initialized from the specified il and args. Use the specified allocator to supply memory.

template<
    class t_INIT_LIST_TYPE,
    class... t_ARGS>
Optional_Base(
    std::allocator_arg_t,
    allocator_type allocator,
    std::in_place_t,
    std::initializer_list<t_INIT_LIST_TYPE> il,
    t_ARGS&&... args);

Created with MrDocs