From ef2e8f1a2f68a5d846032df86838724ce6ab7268 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 18 Jan 2023 13:38:35 +0200 Subject: [PATCH] BAN: Move RemoveReference and IsLValueReference to their own header Also implement basic Less, Equal, Greater --- BAN/include/BAN/Move.h | 15 ++------------- BAN/include/BAN/Traits.h | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 BAN/include/BAN/Traits.h diff --git a/BAN/include/BAN/Move.h b/BAN/include/BAN/Move.h index 1270874e..fb731b03 100644 --- a/BAN/include/BAN/Move.h +++ b/BAN/include/BAN/Move.h @@ -1,21 +1,10 @@ #pragma once +#include + namespace BAN { - template - struct RemoveReference { using type = T; }; - template - struct RemoveReference { using type = T; }; - template - struct RemoveReference { using type = T; }; - - template - struct IsLValueReference { static constexpr bool value = false; }; - template - struct IsLValueReference { static constexpr bool value = true; }; - - template constexpr typename RemoveReference::type&& Move(T&& arg) { diff --git a/BAN/include/BAN/Traits.h b/BAN/include/BAN/Traits.h new file mode 100644 index 00000000..1abda327 --- /dev/null +++ b/BAN/include/BAN/Traits.h @@ -0,0 +1,26 @@ +#pragma once + +namespace BAN +{ + + template + struct RemoveReference { using type = T; }; + template + struct RemoveReference { using type = T; }; + template + struct RemoveReference { using type = T; }; + + template + struct IsLValueReference { static constexpr bool value = false; }; + template + struct IsLValueReference { static constexpr bool value = true; }; + + + template + struct Less { constexpr bool operator()(const T& lhs, const T& rhs) const { return lhs < rhs; } }; + template + struct Equal { constexpr bool operator()(const T& lhs, const T& rhs) const { return lhs == rhs; } }; + template + struct Greater { constexpr bool operator()(const T& lhs, const T& rhs) const { return lhs > rhs; } }; + +} \ No newline at end of file