14 #ifndef LLVM_SUPPORT_TYPE_TRAITS_H
15 #define LLVM_SUPPORT_TYPE_TRAITS_H
17 #include <type_traits>
23 #define LLVM_DEFINED_HAS_FEATURE
24 #define __has_feature(x) 0
35 #if (__has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)) || \
36 (defined(__GNUC__) && __GNUC__ >= 5)
39 static const bool value = std::is_trivially_copyable<T>::value;
40 #elif __has_feature(is_trivially_copyable)
44 static const bool value = __is_trivially_copyable(
T);
48 static const bool value = !std::is_class<T>::value;
53 template<
typename T,
typename U>
66 typedef typename std::remove_reference<T>::type UnderlyingT;
70 !std::is_class<UnderlyingT>::value &&
71 !std::is_pointer<UnderlyingT>::value &&
72 !std::is_floating_point<UnderlyingT>::value &&
73 (std::is_enum<UnderlyingT>::value ||
74 std::is_convertible<UnderlyingT, unsigned long long>::value);
78 template<
typename T,
typename Enable =
void>
83 T, typename std::enable_if<std::is_pointer<T>::value>
::type> {
89 template<
typename T,
typename Enable =
void>
94 T, typename std::enable_if<std::is_pointer<T>::value>
::type> {
95 typedef const typename std::remove_pointer<T>::type *
type;
103 #if __cplusplus >= 201402L
104 #define LLVM_IS_FINAL(Ty) std::is_final<Ty>()
105 #elif __has_feature(is_final) || LLVM_GNUC_PREREQ(4, 7, 0)
106 #define LLVM_IS_FINAL(Ty) __is_final(Ty)
109 #ifdef LLVM_DEFINED_HAS_FEATURE
Metafunction that determines whether the given type is either an integral type or an enumeration type...
If T is a pointer to X, return a pointer to const X.
isPodLike - This is a type trait that is used to determine whether a given type can be copied around ...
If T is a pointer, just return it. If it is not, return T&.
const std::remove_pointer< T >::type * type