Added char8_t, char16_t and char32_t is _integral and is_signed traits

This commit is contained in:
John Wellbelove 2025-05-29 20:19:02 +01:00
parent 1cb75ff072
commit f653279948

View File

@ -288,6 +288,15 @@ namespace etl
template <> struct is_integral<unsigned long> : true_type {};
template <> struct is_integral<long long> : true_type {};
template <> struct is_integral<unsigned long long> : true_type {};
#if ETL_HAS_NATIVE_CHAR8_T
template <> struct is_integral<char8_t> : true_type {};
#endif
#if ETL_HAS_NATIVE_CHAR16_T
template <> struct is_integral<char16_t> : true_type {};
#endif
#if ETL_HAS_NATIVE_CHAR32_T
template <> struct is_integral<char32_t> : true_type {};
#endif
template <typename T> struct is_integral<const T> : is_integral<T> {};
template <typename T> struct is_integral<volatile T> : is_integral<T> {};
template <typename T> struct is_integral<const volatile T> : is_integral<T> {};
@ -310,6 +319,15 @@ namespace etl
template <> struct is_signed<float> : true_type {};
template <> struct is_signed<double> : true_type {};
template <> struct is_signed<long double> : true_type {};
#if ETL_HAS_NATIVE_CHAR8_T
template <> struct is_signed<char8_t> : true_type {};
#endif
#if ETL_HAS_NATIVE_CHAR16_T
template <> struct is_signed<char16_t> : true_type {};
#endif
#if ETL_HAS_NATIVE_CHAR32_T
template <> struct is_signed<char32_t> : true_type {};
#endif
template <typename T> struct is_signed<const T> : is_signed<T> {};
template <typename T> struct is_signed<volatile T> : is_signed<T> {};
template <typename T> struct is_signed<const volatile T> : is_signed<T> {};
@ -416,6 +434,9 @@ namespace etl
/// is_pointer
template<typename T> struct is_pointer_helper : false_type {};
template<typename T> struct is_pointer_helper<T*> : true_type {};
template<typename T> struct is_pointer_helper<const T*> : is_pointer_helper<T*> {};
template<typename T> struct is_pointer_helper<volatile T*> : is_pointer_helper<T*> {};
template<typename T> struct is_pointer_helper<const volatile T*> : is_pointer_helper<T*> {};
template<typename T> struct is_pointer : is_pointer_helper<typename remove_cv<T>::type> {};
#if ETL_USING_CPP17