diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-01-03 01:49:42 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-01-03 01:49:42 +0100 |
commit | c2d4216695b48dfe6bf7083c11e0a7fcbb671e2e (patch) | |
tree | 600719b0f7d7d491eb70ca416b8af3b47bbc28eb /asl/meta.hpp | |
parent | eb58edf811a328ddcc5e671a258be208da212630 (diff) |
Add atomic & is_integer
Diffstat (limited to 'asl/meta.hpp')
-rw-r--r-- | asl/meta.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/asl/meta.hpp b/asl/meta.hpp index f69a4a3..959201e 100644 --- a/asl/meta.hpp +++ b/asl/meta.hpp @@ -177,6 +177,18 @@ template<> struct _is_floating_point_helper<double> : true_type {}; template<typename T> concept is_floating_point = _is_floating_point_helper<un_cv_t<T>>::value;
+template<typename T> struct _is_integer_helper : false_type {};
+template<> struct _is_integer_helper<int8_t> : true_type {};
+template<> struct _is_integer_helper<int16_t> : true_type {};
+template<> struct _is_integer_helper<int32_t> : true_type {};
+template<> struct _is_integer_helper<int64_t> : true_type {};
+template<> struct _is_integer_helper<uint8_t> : true_type {};
+template<> struct _is_integer_helper<uint16_t> : true_type {};
+template<> struct _is_integer_helper<uint32_t> : true_type {};
+template<> struct _is_integer_helper<uint64_t> : true_type {};
+
+template<typename T> concept is_integer = _is_integer_helper<un_cv_t<T>>::value;
+
template<typename T, typename U>
concept equality_comparable_with = requires (const un_cvref_t<T>& a, const un_cvref_t<T>& b)
{
|