fix move ctor/assignment

This commit is contained in:
Günter Obiltschnig
2020-01-21 19:58:12 +01:00
parent 18adb1e43b
commit eeb64cc340
4 changed files with 50 additions and 48 deletions

View File

@@ -105,7 +105,7 @@ public:
Optional& assign(C&& value)
/// Moves a value into the Optional.
{
_value = value;
_value = std::move(value);
_isSpecified = true;
return *this;
}
@@ -125,7 +125,7 @@ public:
Optional& operator = (C&& value)
{
return assign(value);
return assign(std::move(value));
}
Optional& operator = (const Optional& other)