15#ifndef A_UTIL_UTIL_BASE_TYPE_TRAITS_H
16#define A_UTIL_UTIL_BASE_TYPE_TRAITS_H
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))
61template <
typename T,
bool = std::is_enum_v<T>>
79 using type = std::underlying_type_t<T>;
88template <
class T,
bool is_enum = std::is_enum_v<T>>
100template <
class T,
class U,
class =
void>
101struct is_explicitly_convertible_to_impl : std::false_type {
104template <
class T,
class U>
105struct is_explicitly_convertible_to_impl<T,
107 std::void_t<decltype(static_cast<U>(std::declval<T>()))>>
124template <
class T,
class U>
138template <
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.
Definition type_traits.h:89
constexpr bool is_explicitly_convertible_to_v
Definition type_traits.h:139
Serves as the root component, with common functionality documented in core functionality.
Definition base.h:24
Checks if there is an explicitly defined conversion from U to T.
Definition type_traits.h:125
std::underlying_type_t< T > type
The type of the underlying type retrieved.
Definition type_traits.h:79
Retrieves the underlying type if T is an enum, otherwise the type itself.
Definition type_traits.h:62
T type
The type of the underlying type retrieved.
Definition type_traits.h:66
constexpr bool is_enum_v
Definition type_traits.h:45