From 4228e82740f62b841799cfca04861fa217fb93a5 Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Thu, 1 Aug 2024 00:56:05 +0200 Subject: More work on taxonomy --- asl/meta/internal/quals.hpp | 16 ++++++++++++++++ asl/meta/internal/refs.hpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ asl/meta/internal/types.hpp | 9 +++++++++ 3 files changed, 70 insertions(+) create mode 100644 asl/meta/internal/quals.hpp create mode 100644 asl/meta/internal/refs.hpp create mode 100644 asl/meta/internal/types.hpp (limited to 'asl/meta/internal') diff --git a/asl/meta/internal/quals.hpp b/asl/meta/internal/quals.hpp new file mode 100644 index 0000000..869cc89 --- /dev/null +++ b/asl/meta/internal/quals.hpp @@ -0,0 +1,16 @@ +#pragma once + +#include "asl/meta/types.hpp" + +namespace asl::internal { + +template struct const_helper { using add = const T; using remove = T; }; +template struct const_helper { using add = const T; using remove = T; }; + +template concept is_const = same::add>; + +template struct volatile_helper { using add = volatile T; using remove = T; }; +template struct volatile_helper { using add = volatile T; using remove = T; }; + +} // namespace asl::internal + diff --git a/asl/meta/internal/refs.hpp b/asl/meta/internal/refs.hpp new file mode 100644 index 0000000..b21a0a1 --- /dev/null +++ b/asl/meta/internal/refs.hpp @@ -0,0 +1,45 @@ +#pragma once + +#include "asl/meta/types.hpp" + +namespace asl::internal { + +template +inline constexpr bool is_referenceable = false; + +template +inline constexpr bool is_referenceable> = true; + +template> +struct as_ref_helper { using lvalue = T; using rvalue = T; }; + +template +struct as_ref_helper { using lvalue = T&; using rvalue = T&&; }; + +template struct un_ref_helper { using type = T; }; +template struct un_ref_helper { using type = T; }; +template struct un_ref_helper { using type = T; }; + +template +struct is_ref_helper +{ + static inline constexpr bool lref = false; + static inline constexpr bool rref = false; +}; + +template +struct is_ref_helper +{ + static inline constexpr bool lref = true; + static inline constexpr bool rref = false; +}; + +template +struct is_ref_helper +{ + static inline constexpr bool lref = false; + static inline constexpr bool rref = true; +}; + +} // namespace asl::internal + diff --git a/asl/meta/internal/types.hpp b/asl/meta/internal/types.hpp new file mode 100644 index 0000000..f635de5 --- /dev/null +++ b/asl/meta/internal/types.hpp @@ -0,0 +1,9 @@ +#pragma once + +namespace asl::internal { + +template inline constexpr bool is_same = false; +template inline constexpr bool is_same = true; + +} // namespace asl::internal + -- cgit