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) &&;

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

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

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) &&;

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 &;

Return Value

contained value if engaged, otherwise value converted to t_TYPE

Parameters

Name

Description

value

value compared with or used to initialize the optional

allocatorArg

tag selecting the allocator‐extended constructor

allocator

allocator used to supply memory

Created with MrDocs