From fcb0e975ab88a2faa86667b6a723ab2285035672 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 26 May 2024 21:04:36 +0200 Subject: a --- serialize/savegame.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'serialize') diff --git a/serialize/savegame.cpp b/serialize/savegame.cpp index 0c664eed..ef46a3f9 100644 --- a/serialize/savegame.cpp +++ b/serialize/savegame.cpp @@ -1,6 +1,7 @@ #include "binary-writer.inl" #include "binary-reader.inl" #include "compat/defs.hpp" +#include "compat/non-const.hpp" #include "compat/strerror.hpp" #include "compat/int-hash.hpp" #include "compat/exception.hpp" @@ -66,16 +67,6 @@ template concept Number = std::is_arithmetic_v concept Enum = std::is_enum_v>; template concept Vector = Math::IsVector>::value; -template [[maybe_unused]] T& non_const(const T& value) { return const_cast(value); } -template [[maybe_unused]] T& non_const(T& value) = delete; -template [[maybe_unused]] T& non_const(T&&) = delete; -template [[maybe_unused]] T& non_const(const T&& value) = delete; - -template [[maybe_unused]] T& non_const_(const T& value) { return const_cast(value); } -template [[maybe_unused]] T& non_const_(T& value) { return value; } -template [[maybe_unused]] T& non_const_(T&& value) { return static_cast(value); } -template [[maybe_unused]] T& non_const_(const T&& value) { return static_cast(const_cast(value)); } - struct buffer { std::unique_ptr data; -- cgit v1.2.3