diff options
Diffstat (limited to 'libk/types.h')
-rw-r--r-- | libk/types.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libk/types.h b/libk/types.h index 7f16206..3e728fb 100644 --- a/libk/types.h +++ b/libk/types.h @@ -35,7 +35,7 @@ typedef long long int int64_t; constexpr int64_t int64_t_max = uint64_t_max / 2; constexpr int64_t int64_t_min = -int64_t_max - 1; -// Type Traits +/* Type Traits */ template <class T, T v> struct integral_constant { @@ -54,3 +54,7 @@ struct is_same<T, T> : integral_constant<bool, true> {}; /* is_unsigned */ template <typename T> struct is_unsigned : integral_constant<bool, (T{0} < static_cast<T>(-1))> {}; + +/* error enum concept */ +template <typename T> +concept error_enum_t = (__is_enum(T) && requires { T::NoError; }); |