|
ROOT
Reference Guide |
|
Go to the documentation of this file.
12 #ifndef ROOT_TypeTraits
13 #define ROOT_TypeTraits
16 #include <type_traits>
24 template <
typename... Types>
26 static constexpr std::size_t
list_size =
sizeof...(Types);
31 template <
typename T> constexpr
auto HasCallOp(
int ) -> decltype(&T::operator(),
true) {
return true; }
32 template <
typename T> constexpr
bool HasCallOp(
char ) {
return false; }
35 template <typename T, bool HasCallOp = ROOT::Detail::HasCallOp<T>(0)>
47 template <
typename R,
typename T,
typename... Args>
55 template <
typename R,
typename T,
typename... Args>
63 template <
typename R,
typename... Args>
71 template <
typename R,
typename... Args>
83 class IsSmartOrDumbPtr :
public std::integral_constant<bool, std::is_pointer<T>::value> {
91 class IsSmartOrDumbPtr<std::unique_ptr<P>> :
public std::true_type {
97 std::is_integral<T>::value &&
98 std::is_signed<T>::value &&
99 !std::is_same<T, char>::value
105 std::is_integral<T>::value &&
106 !std::is_signed<T>::value &&
107 !std::is_same<T, char>::value
122 template <
typename T,
typename... Rest>
127 template <
typename... Types>
132 template <
typename T,
typename... Rest>
137 template <
typename... Args>
144 template <
typename T>
149 template <
template <
typename...>
class Template,
typename T,
typename... Rest>
154 template <
typename T>
163 template <
typename T,
template <
typename...>
class U,
typename... Rest>
168 template <
typename T>
171 template <
typename T>
174 template <
typename V>
175 using Begin_t =
typename V::const_iterator (V::*)()
const;
177 template <
typename V>
178 using End_t =
typename V::const_iterator (V::*)()
const;
180 template <
typename V>
187 template <
typename V>
193 static constexpr
bool const value = Check<T>(0);
std::is_floating_point< T > IsFloatNumeral
Checks for floating point types (that are not characters)
static constexpr bool const value
typename CallableTraitsImpl< decltype(&T::operator())>::ret_type ret_type
typename RemoveFirst< Args... >::type RemoveFirst_t
Extract types from the signature of a callable object. See CallableTraits.
constexpr auto HasCallOp(int) -> decltype(&T::operator(), true)
typename V::const_iterator(V::*)() const End_t
Lightweight storage for a collection of types.
typename CallableTraitsImpl< decltype(&T::operator())>::arg_types_nodecay arg_types_nodecay
typename TakeFirstType< Types... >::type TakeFirstType_t
typename TakeFirstParameter< T >::type TakeFirstParameter_t
typename RemoveFirstParameter< T >::type RemoveFirstParameter_t
static constexpr std::size_t list_size
static constexpr auto Check(int) -> decltype(static_cast< Begin_t< V >>(&V::begin), static_cast< End_t< V >>(&V::end), true)
#define R(a, b, c, d, e, f, g, h, i)
Checks for signed integers types that are not characters.
typename CallableTraitsImpl< decltype(&T::operator())>::arg_types arg_types
static constexpr bool Check(...)
typedef void((*Func_t)())
typename V::const_iterator(V::*)() const Begin_t
Return first of possibly many template parameters.
Remove first of possibly many template parameters.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Checks for unsigned integer types that are not characters.