forked from boostorg/optional
added missing overload for value_or fo non-C++11 compilers
This commit is contained in:
@ -1106,6 +1106,15 @@ class optional : public optional_detail::optional_base<T>
|
|||||||
else
|
else
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class U>
|
||||||
|
value_type value_or ( U& v ) const
|
||||||
|
{
|
||||||
|
if (this->is_initialized())
|
||||||
|
return get();
|
||||||
|
else
|
||||||
|
return v;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user