Fixed optional move constructor for references.
This commit is contained in:
@@ -173,7 +173,12 @@ Optional<TValue>::Optional(Optional&& other) noexcept
|
||||
{
|
||||
if (other)
|
||||
{
|
||||
emplace(std::move(other.get()));
|
||||
if constexpr (!std::is_reference_v<TValue>) {
|
||||
emplace(std::move(other.get()));
|
||||
}
|
||||
else {
|
||||
emplace(other.get());
|
||||
}
|
||||
other.reset();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user