From 19a4e2ab58e1dd058709243ac9e7488e7d9f9a5a Mon Sep 17 00:00:00 2001 From: apio Date: Fri, 16 Dec 2022 18:11:17 +0100 Subject: [PATCH] Result, Option: Make sure everything is properly moved --- luna/include/luna/Option.h | 2 +- luna/include/luna/Result.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/luna/include/luna/Option.h b/luna/include/luna/Option.h index 49d58ee7..a80cf433 100644 --- a/luna/include/luna/Option.h +++ b/luna/include/luna/Option.h @@ -126,7 +126,7 @@ template class Option void store_moved_reference(T&& ref) { - new (buffer) T(ref); + new (buffer) T(move(ref)); } void destroy() diff --git a/luna/include/luna/Result.h b/luna/include/luna/Result.h index 1b93b37e..68581a28 100644 --- a/luna/include/luna/Result.h +++ b/luna/include/luna/Result.h @@ -25,7 +25,7 @@ template 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 class Result } } - Result(Result&& other) : m_value(other.m_value) + Result(Result&& other) : m_value(move(other.m_value)) { if (!other.m_has_error) {