mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 02:53:10 +01:00
additional move support for Nullable and Optional
This commit is contained in:
@@ -82,6 +82,14 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
Nullable(C&& value):
|
||||
/// Creates a Nullable by moving the given value.
|
||||
_value(value),
|
||||
_isNull(false),
|
||||
_null()
|
||||
{
|
||||
}
|
||||
|
||||
Nullable(const Nullable& other):
|
||||
/// Creates a Nullable by copying another one.
|
||||
_value(other._value),
|
||||
@@ -112,6 +120,14 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
Nullable& assign(C&& value)
|
||||
/// Assigns a value to the Nullable.
|
||||
{
|
||||
_value = value;
|
||||
_isNull = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Nullable& assign(const Nullable& other)
|
||||
/// Assigns another Nullable.
|
||||
{
|
||||
@@ -133,6 +149,12 @@ public:
|
||||
return assign(value);
|
||||
}
|
||||
|
||||
Nullable& operator = (C&& value)
|
||||
/// Move-assigns a value to the Nullable.
|
||||
{
|
||||
return assign(value);
|
||||
}
|
||||
|
||||
Nullable& operator = (const Nullable& other)
|
||||
/// Assigns another Nullable.
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user