value_or overloads
Synopses
Declared in <bslstl_optional.h>
Return a copy of the underlying object of a (template parameter) t_TYPE if this object is non‐null, and the specified value converted to t_TYPE otherwise. Note that this method returns by value, so may be inefficient in some contexts.
template<class t_ANY_TYPE>
t_TYPE
value_or(t_ANY_TYPE&& value) &&;
Return a copy of the underlying object of a (template parameter) t_TYPE if this object is non‐null, and the specified value converted to t_TYPE otherwise. Note that this method returns by value, so may be inefficient in some contexts.
template<class t_ANY_TYPE>
t_TYPE
value_or(t_ANY_TYPE&& value) const &;
If this object is non‐null, return a copy of the underlying object of a (template parameter) t_TYPE created using the provided allocator, and the specified value converted to t_TYPE using the specified allocator otherwise. Note that this method returns by value, so may be inefficient in some contexts.
template<class t_ANY_TYPE>
t_TYPE
value_or(
std::allocator_arg_t,
allocator_type allocator,
t_ANY_TYPE&& value) &&;
If this object is non‐null, return a copy of the underlying object of a (template parameter) t_TYPE created using the provided allocator, and the specified value converted to t_TYPE using the specified allocator otherwise. Note that this method returns by value, so may be inefficient in some contexts.
template<class t_ANY_TYPE>
t_TYPE
value_or(
std::allocator_arg_t,
allocator_type allocator,
t_ANY_TYPE&& value) const &;
Created with MrDocs