12 #ifndef ROOT_TypeTraits 13 #define ROOT_TypeTraits 16 #include <type_traits> 26 template <
typename... Types>
28 static constexpr std::size_t
list_size =
sizeof...(Types);
33 template <
typename T> constexpr
auto HasCallOp(
int ) -> decltype(&T::operator(),
true) {
return true; }
34 template <
typename T> constexpr
bool HasCallOp(
char ) {
return false; }
37 template <
typename T,
bool HasCallOp = ROOT::Detail::HasCallOp<T>(0)>
49 template <
typename R,
typename T,
typename... Args>
57 template <
typename R,
typename T,
typename... Args>
65 template <
typename R,
typename... Args>
73 template <
typename R,
typename... Args>
85 class IsSmartOrDumbPtr :
public std::integral_constant<bool, std::is_pointer<T>::value> {
101 template <
typename A>
102 static constexpr
bool Test(
A *
pt,
A const *cpt =
nullptr, decltype(pt->begin()) * =
nullptr,
103 decltype(pt->end()) * =
nullptr, decltype(cpt->begin()) * =
nullptr,
104 decltype(cpt->end()) * =
nullptr,
typename A::iterator *
pi =
nullptr,
105 typename A::const_iterator *pci =
nullptr)
107 using It_t =
typename A::iterator;
108 using CIt_t =
typename A::const_iterator;
109 using V_t =
typename A::value_type;
110 return std::is_same<Test_t, std::vector<bool>>::value ||
111 (std::is_same<decltype(pt->begin()), It_t>::value && std::is_same<decltype(pt->end()), It_t>::value &&
112 std::is_same<decltype(cpt->begin()), CIt_t>::value && std::is_same<decltype(cpt->end()), CIt_t>::value &&
113 std::is_same<decltype(**
pi), V_t &>::value && std::is_same<decltype(**pci), V_t const &>::value);
116 template <
typename A>
117 static constexpr
bool Test(...)
122 static constexpr
bool value = Test<Test_t>(
nullptr);
127 static constexpr
bool value =
true;
138 template <
typename T,
typename... Rest>
143 template <
typename... Types>
148 template <
typename T,
typename... Rest>
153 template <
typename... Args>
160 template <
typename T>
165 template <
template <
typename...>
class Template,
typename T,
typename... Rest>
170 template <
typename T>
179 template <
typename T,
template <
typename...>
class U,
typename... Rest>
184 template <
typename T>
189 #endif // ROOT_TTypeTraits Remove first of possibly many template parameters.
typename RemoveFirstParameter< T >::type RemoveFirstParameter_t
ROOT::TypeTraits::TypeList< typename std::decay< Args >::type... > arg_types
constexpr bool HasCallOp(char)
static constexpr double pi
Namespace for new ROOT classes and functions.
typename TakeFirstParameter< T >::type TakeFirstParameter_t
ROOT::TypeTraits::TypeList< Args... > arg_types_nodecay
typename CallableTraitsImpl< decltype(&T::operator())>::arg_types_nodecay arg_types_nodecay
typename RemoveFirst< Args... >::type RemoveFirst_t
static constexpr std::size_t list_size
typename CallableTraitsImpl< decltype(&T::operator())>::arg_types arg_types
static constexpr bool Test(...)
ROOT::TypeTraits::TypeList< typename std::decay< Args >::type... > arg_types
ROOT::TypeTraits::TypeList< Args... > arg_types_nodecay
static constexpr bool Test(A *pt, A const *cpt=nullptr, decltype(pt->begin()) *=nullptr, decltype(pt->end()) *=nullptr, decltype(cpt->begin()) *=nullptr, decltype(cpt->end()) *=nullptr, typename A::iterator *pi=nullptr, typename A::const_iterator *pci=nullptr)
ROOT::TypeTraits::TypeList< Args... > arg_types_nodecay
ROOT::TypeTraits::TypeList< typename std::decay< Args >::type... > arg_types
typename TakeFirstType< Types... >::type TakeFirstType_t
Lightweight storage for a collection of types.
ROOT::TypeTraits::TypeList< typename std::decay< Args >::type... > arg_types
Extract types from the signature of a callable object. See CallableTraits.
typedef void((*Func_t)())
typename std::decay< T >::type Test_t
ROOT::TypeTraits::TypeList< Args... > arg_types_nodecay
Check for container traits.
typename CallableTraitsImpl< decltype(&T::operator())>::ret_type ret_type
Return first of possibly many template parameters.