From e939e5e6a894a042d3301e47faa05264445f27f6 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Mon, 7 Oct 2024 09:29:49 +0200 Subject: Internal improvements: new strong types StackIndex and KeeperIndex --- src/macros_and_utils.h | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'src/macros_and_utils.h') diff --git a/src/macros_and_utils.h b/src/macros_and_utils.h index 1b1ced6..e73abef 100644 --- a/src/macros_and_utils.h +++ b/src/macros_and_utils.h @@ -2,6 +2,7 @@ #include "debug.h" #include "luaerrors.h" +#include "unique.hpp" using namespace std::chrono_literals; @@ -24,40 +25,9 @@ using lua_Duration = std::chrono::template duration; // ################################################################################################# -// A unique type generator -template -class Unique -{ - private: - T val; - - public: - using type = T; - Unique() = default; - operator T() const { return val; } - explicit Unique(T b_) - : val{ b_ } - { - } -}; - -template -class Unique>> -: public T -{ - public: - using type = T; - using T::T; - explicit Unique(T const& b_) - : T{ b_ } - { - } -}; - -// ################################################################################################# - using SourceState = Unique; using DestState = Unique; +using StackIndex = Unique; // ################################################################################################# -- cgit v1.2.3-55-g6feb