#3196: std::forward for Poco::Optional ctor with rvalue

This commit is contained in:
Günter Obiltschnig
2021-06-14 23:47:51 +02:00
parent 06fe07e7ad
commit 8e5a2c313b
3 changed files with 40 additions and 40 deletions

View File

@@ -84,7 +84,7 @@ public:
Nullable(C&& value): Nullable(C&& value):
/// Creates a Nullable by moving the given value. /// Creates a Nullable by moving the given value.
_value(value), _value(std::forward<C>(value)),
_isNull(false), _isNull(false),
_null() _null()
{ {

View File

@@ -69,7 +69,7 @@ public:
Optional(C&& value): Optional(C&& value):
/// Creates a Optional by moving the given value. /// Creates a Optional by moving the given value.
_value(value), _value(std::forward<C>(value)),
_isSpecified(true) _isSpecified(true)
{ {
} }

View File

@@ -1034,7 +1034,7 @@ void CoreTest::testNullable()
assertTrue (n2 != n1); assertTrue (n2 != n1);
assertTrue (n1 > n2); assertTrue (n1 > n2);
NullType nd; NullType nd{};
assertTrue (n1 != nd); assertTrue (n1 != nd);
assertTrue (nd != n1); assertTrue (nd != n1);
n1.clear(); n1.clear();