BloombergLP::bslstl::Optional_Base::value_or

Return the contained value, or a converted fallback if disengaged.

Synopses

Declared in <bslstl_optional.h>

Return the contained value, or a converted fallback if disengaged.

template<class t_ANY_TYPE>
t_TYPE
value_or(t_ANY_TYPE&& value) &&;
» more...

Return the contained value, or a converted fallback if disengaged.

template<class t_ANY_TYPE>
t_TYPE
value_or(t_ANY_TYPE&& value) const &;
» more...

Return the contained value, or a converted fallback if disengaged.

template<class t_ANY_TYPE>
t_TYPE
value_or(
    std::allocator_arg_t allocatorArg,
    allocator_type allocator,
    t_ANY_TYPE&& value) &&;
» more...

Return the contained value, or a converted fallback if disengaged.

template<class t_ANY_TYPE>
t_TYPE
value_or(
    std::allocator_arg_t allocatorArg,
    allocator_type allocator,
    t_ANY_TYPE&& value) const &;
» more...

Return Value

contained value if engaged, otherwise value converted to t_TYPE

Parameters

NameDescription
valuevalue compared with or used to initialize the optional
allocatorArgtag selecting the allocator-extended constructor
allocatorallocator used to supply memory