12#ifndef ROOT_TypeTraits
13#define ROOT_TypeTraits
24template <
typename... Types>
26 static constexpr std::size_t
list_size =
sizeof...(Types);
31template <
typename T>
constexpr auto HasCallOp(
int ) ->
decltype(&T::operator(),
true) {
return true; }
32template <
typename T>
constexpr bool HasCallOp(
char ) {
return false; }
35template <typename T, bool HasCallOp = ROOT::Detail::HasCallOp<T>(0)>
47template <
typename R,
typename T,
typename... Args>
55template <
typename R,
typename T,
typename... Args>
63template <
typename R,
typename... Args>
71template <
typename R,
typename... Args>
83class IsSmartOrDumbPtr :
public std::integral_constant<bool, std::is_pointer<T>::value> {
91class 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
122template <
typename T,
typename... Rest>
127template <
typename... Types>
132template <
typename T,
typename... Rest>
137template <
typename... Args>
149template <
template <
typename...>
class Template,
typename T,
typename... Rest>
163template <
typename T,
template <
typename...>
class U,
typename... Rest>
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>
197template <
typename F,
typename... Args>
198#ifdef __cpp_lib_is_invocable
199using InvokeResult_t = std::invoke_result_t<
F, Args...>;
typename TakeFirstParameter< T >::type TakeFirstParameter_t
typename RemoveFirst< Args... >::type RemoveFirst_t
ROOT::Detail::CallableTraitsImpl< F > CallableTraits
Extract types from the signature of a callable object.
std::is_floating_point< T > IsFloatNumeral
Checks for floating point types (that are not characters).
std::result_of_t< F(Args...)> InvokeResult_t
An adapter for std::invoke_result that falls back to std::result_of if the former is not available.
typename TakeFirstType< Types... >::type TakeFirstType_t
typename RemoveFirstParameter< T >::type RemoveFirstParameter_t
Special implementation of ROOT::RRangeCast for TCollection, including a check that the cast target ty...
constexpr auto HasCallOp(int) -> decltype(&T::operator(), true)
namespace associated R package for ROOT.
ROOT type_traits extensions.
ROOT::TypeTraits::TypeList< std::decay_t< Args >... > arg_types
ROOT::TypeTraits::TypeList< Args... > arg_types_nodecay
ROOT::TypeTraits::TypeList< Args... > arg_types_nodecay
ROOT::TypeTraits::TypeList< std::decay_t< Args >... > arg_types
ROOT::TypeTraits::TypeList< std::decay_t< Args >... > arg_types
ROOT::TypeTraits::TypeList< Args... > arg_types_nodecay
ROOT::TypeTraits::TypeList< std::decay_t< Args >... > arg_types
ROOT::TypeTraits::TypeList< Args... > arg_types_nodecay
typename CallableTraitsImpl< decltype(&T::operator())>::arg_types arg_types
typename CallableTraitsImpl< decltype(&T::operator())>::arg_types_nodecay arg_types_nodecay
typename CallableTraitsImpl< decltype(&T::operator())>::ret_type ret_type
Extract types from the signature of a callable object. See CallableTraits.
typename V::const_iterator(V::*)() const Begin_t
static constexpr bool Check(...)
static constexpr auto Check(int) -> decltype(static_cast< Begin_t< V > >(&V::begin), static_cast< End_t< V > >(&V::end), true)
typename V::const_iterator(V::*)() const End_t
static constexpr bool const value
Checks for signed integers types that are not characters.
Checks for unsigned integer types that are not characters.
Remove first of possibly many template parameters.
Return first of possibly many template parameters.
Lightweight storage for a collection of types.
static constexpr std::size_t list_size