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