15 #ifndef A_UTIL_UTIL_BASE_TYPE_TRAITS_H
16 #define A_UTIL_UTIL_BASE_TYPE_TRAITS_H
20 #include <type_traits>
22 #if defined(__GNUC__) && (__GNUC__ == 5) && defined(__QNX__)
23 #pragma GCC diagnostic ignored \
27 #if (defined(__GNUC__) && (__GNUC__ < 7)) || (defined(_MSC_VER) && (_MSC_VER < 1920))
34 template <
typename...>
61 template <
typename T,
bool = std::is_enum_v<T>>
79 using type = std::underlying_type_t<T>;
88 template <
class T,
bool is_enum = std::is_enum_v<T>>
100 template <
class T,
class U,
class =
void>
101 struct is_explicitly_convertible_to_impl : std::false_type {
104 template <
class T,
class U>
105 struct is_explicitly_convertible_to_impl<T,
107 std::void_t<decltype(static_cast<U>(std::declval<T>()))>>
124 template <
class T,
class U>
138 template <
class T,
class U>
144 #if defined(__GNUC__) && (__GNUC__ == 5) && defined(__QNX__)
145 #pragma GCC diagnostic warning \
typename underlying_type_or_type< T, is_enum >::type underlying_type_or_type_t
Retrieves the underlying type if T is an enum, otherwise the type itself.
constexpr bool is_explicitly_convertible_to_v
Helper variable template for is_explicitly_convertible_to.
Checks for std::is_enum_v and defines HAS_IS_ENUM_V accordingly.
Serves as the root component, with common functionality documented in core functionality.
Checks if there is an explicitly defined conversion from U to T.
Retrieves the underlying type of the enum type T.
std::underlying_type_t< T > type
The type of the underlying type retrieved.
Retrieves the underlying type if T is an enum, otherwise the type itself.
T type
The type of the underlying type retrieved.
constexpr bool is_enum_v
C++17 backport of std::is_enum_v.