Result, Option: Make sure everything is properly moved

This commit is contained in:
apio 2022-12-16 18:11:17 +01:00
parent e729c38200
commit 19a4e2ab58
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 3 additions and 3 deletions

View File

@ -126,7 +126,7 @@ template <typename T> class Option
void store_moved_reference(T&& ref)
{
new (buffer) T(ref);
new (buffer) T(move(ref));
}
void destroy()

View File

@ -25,7 +25,7 @@ template <typename T> class Result
m_has_error = false;
}
Result(T&& value) : m_value(value)
Result(T&& value) : m_value(move(value))
{
m_has_value = true;
m_has_error = false;
@ -46,7 +46,7 @@ template <typename T> class Result
}
}
Result(Result<T>&& other) : m_value(other.m_value)
Result(Result<T>&& other) : m_value(move(other.m_value))
{
if (!other.m_has_error)
{