summaryrefslogtreecommitdiffhomepage
path: root/serialize
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-05-26 21:04:36 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-05-26 21:30:56 +0200
commitfcb0e975ab88a2faa86667b6a723ab2285035672 (patch)
tree9aeef968480b7be11cda5c93ea23e132c60084f6 /serialize
parentafdb73b18329d1e135340ac4a7aab952648fada8 (diff)
a
Diffstat (limited to 'serialize')
-rw-r--r--serialize/savegame.cpp11
1 files changed, 1 insertions, 10 deletions
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<typename T> concept Number = std::is_arithmetic_v<std::remove_cvref_t<T
template<typename T> concept Enum = std::is_enum_v<std::remove_cvref_t<T>>;
template<typename T> concept Vector = Math::IsVector<std::remove_cvref_t<T>>::value;
-template<typename T> [[maybe_unused]] T& non_const(const T& value) { return const_cast<T&>(value); }
-template<typename T> [[maybe_unused]] T& non_const(T& value) = delete;
-template<typename T> [[maybe_unused]] T& non_const(T&&) = delete;
-template<typename T> [[maybe_unused]] T& non_const(const T&& value) = delete;
-
-template<typename T> [[maybe_unused]] T& non_const_(const T& value) { return const_cast<T&>(value); }
-template<typename T> [[maybe_unused]] T& non_const_(T& value) { return value; }
-template<typename T> [[maybe_unused]] T& non_const_(T&& value) { return static_cast<T&>(value); }
-template<typename T> [[maybe_unused]] T& non_const_(const T&& value) { return static_cast<T&>(const_cast<T&&>(value)); }
-
struct buffer
{
std::unique_ptr<char[]> data;