14 #ifndef LLVM_SUPPORT_TYPE_TRAITS_H
15 #define LLVM_SUPPORT_TYPE_TRAITS_H
17 #include <type_traits>
21 #define LLVM_DEFINED_HAS_FEATURE
22 #define __has_feature(x) 0
33 #if (__has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)) || \
34 (defined(__GNUC__) && __GNUC__ >= 5)
37 static const bool value = std::is_trivially_copyable<T>::value;
38 #elif __has_feature(is_trivially_copyable)
42 static const bool value = __is_trivially_copyable(T);
46 static const bool value = !std::is_class<T>::value;
51 template<
typename T,
typename U>
63 typedef typename std::remove_reference<T>::type UnderlyingT;
66 static const bool value =
67 !std::is_class<UnderlyingT>::value &&
68 !std::is_pointer<UnderlyingT>::value &&
69 !std::is_floating_point<UnderlyingT>::value &&
70 std::is_convertible<UnderlyingT, unsigned long long>::value;
74 template<
typename T,
typename Enable =
void>
79 T, typename std::enable_if<std::is_pointer<T>::value>::type> {
85 template<
typename T,
typename Enable =
void>
90 T, typename std::enable_if<std::is_pointer<T>::value>::type> {
91 typedef const typename std::remove_pointer<T>::type *type;
96 #ifdef LLVM_DEFINED_HAS_FEATURE
Metafunction that determines whether the given type is either an integral type or an enumeration type...
Definition: type_traits.h:62
If T is a pointer to X, return a pointer to const X.
Definition: type_traits.h:86
isPodLike - This is a type trait that is used to determine whether a given type can be copied around ...
Definition: StringRef.h:535
If T is a pointer, just return it. If it is not, return T&.
Definition: type_traits.h:75