added missing overload for value_or fo non-C++11 compilers

This commit is contained in:
Andrzej Krzemienski
2015-03-10 07:14:36 +01:00
parent 6e40825098
commit 15d9fcdbd1

View File

@ -1106,6 +1106,15 @@ class optional : public optional_detail::optional_base<T>
else
return v;
}
template <class U>
value_type value_or ( U& v ) const
{
if (this->is_initialized())
return get();
else
return v;
}
#endif