Return the contained value, or a converted fallback if disengaged.
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...
contained value if engaged, otherwise value converted to t_TYPE
| 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 |