Compare commits

...
Author SHA1 Message Date
Automatic Release Builder e5bef3f97f Extend simgear::Optional with value_or
Needed to allow parity with C++17 use on next
2022-02-03 12:52:58 +00:00
+16
View File
@@ -74,6 +74,22 @@ public:
return _value;
}
const T& value_or(const T& defaultValue) const
{
if (!_haveValue) {
return defaultValue;
}
return _value;
}
T& value_or(T& defaultValue) const
{
if (!_haveValue) {
return defaultValue;
}
return _value;
}
T& value()
{
if (!_haveValue) {