2#ifndef RIVET_TypeTraits_HH
3#define RIVET_TypeTraits_HH
29 struct TypeTraits<const U&> {
30 using ArgType = RefType;
34 struct TypeTraits<const U*> {
35 using ArgType = PtrType;
41 template <
typename T,
typename=
void>
42 struct Derefable : std::false_type {};
45 struct Derefable<T,
std::void_t< decltype(*std::declval<T>())> > : std::true_type {};
51 template<
typename T,
typename =
void>
52 struct Iterable : std::false_type { };
55 struct Iterable<T,
std::void_t<std::decay_t<decltype(std::begin(std::declval<const T&>()))>,
56 std::decay_t<decltype(std::end(std::declval<const T&>()))>>> : std::true_type { };
59 inline constexpr bool is_iterable_v = Iterable<T>::value;
64 using isIterable = std::enable_if_t<Iterable<T>::value>;
68 template<
typename T,
typename =
void>
69 struct CIterable : std::false_type { };
72 struct CIterable<T,
std::void_t<decltype(std::declval<typename std::decay_t<T>::const_iterator>())>> : std::true_type { };
75 inline constexpr bool is_citerable_v = CIterable<T>::value;
79 template<
typename... Args>
80 using isCIterable = std::enable_if_t<(CIterable<Args>::value && ...)>;
84 struct isCString : std::false_type { };
87 struct isCString<char[]> : std::true_type { };
90 struct isCString<char[N]> : std::true_type { };
93 inline constexpr bool is_cstring_v = isCString<T>::value;
97 template<
typename T,
typename =
void>
98 struct hasBinning : std::false_type { };
101 struct hasBinning<T,
std::void_t<decltype(std::declval<T>().binning())>> : std::true_type { };
105 template<
typename T,
typename =
void>
106 struct isFillable : std::false_type { };
109 struct isFillable<T,
std::void_t<decltype(typename T::FillType{})>> : std::true_type { };
113 template<
typename T,
typename U,
typename =
void>
114 struct isArgumentOf : std::false_type { };
116 template<
typename T,
typename U>
117 struct isArgumentOf<T, U,
std::void_t<decltype(T(std::declval<U>()))>>
118 : std::true_type { };
121 template <
typename T,
typename... Us>
122 using allArgumentsOf =
typename std::conjunction<isArgumentOf<T, Us>...>;
125 template <
typename T,
typename=
void>
126 struct HasXYZ : std::false_type {};
127 template <
typename T>
128 struct HasXYZ<T,
std::void_t< decltype(std::declval<T>().x() + std::declval<T>().y() +
129 std::declval<T>().z())> > : std::true_type {};
133 template <
typename T,
typename=
void>
134 struct HasXYZT : std::false_type {};
135 template <
typename T>
136 struct HasXYZT<T,
std::void_t< decltype(std::declval<T>().x() + std::declval<T>().y() +
137 std::declval<T>().z() + std::declval<T>().t())> > : std::true_type {};
Definition MC_CENT_PPB_Projections.hh:10