10#ifndef MCRL2_UTILITIES_TYPE_TRAITS_H
11#define MCRL2_UTILITIES_TYPE_TRAITS_H
20template <
typename T,
typename =
void>
25 decltype(std::end(std::declval<T>()))
27 > : std::true_type {};
30template<
typename T,
typename =
void>
34struct is_iterator<T, typename
std::enable_if<!std::is_same<typename std::iterator_traits<T>::value_type, void>::value>::type>
39template<
typename... Conds>
43template<
typename Cond,
typename... Conds>
45 : std::conditional<Cond::value, forall<Conds...>, std::false_type>::type
55template <
typename FunctionType,
typename ResultType,
typename =
void>
57 :
public std::false_type
61template <
typename FunctionType,
typename ResultType>
63 typename
std::is_convertible<typename std::result_of<FunctionType()>::type, ResultType> >
64 :
public std::true_type
67template <
typename FunctionType,
typename ArgumentType,
typename =
void>
69 :
public std::false_type
73template <
typename FunctionType,
typename ArgumentType>
75 typename
std::result_of<FunctionType(ArgumentType)>::type>
76 :
public std::true_type
79template <
typename FunctionType,
typename ArgumentType1,
typename ArgumentType2,
typename =
void>
81 :
public std::false_type
85template <
typename FunctionType,
typename ArgumentType1,
typename ArgumentType2>
87 typename
std::result_of<FunctionType(ArgumentType1,ArgumentType2)>::type>
88 :
public std::true_type
97template <
typename ClassType,
typename ReturnType,
typename... Args>
101 enum { arity =
sizeof...(Args) };
109 typedef typename std::tuple_element<i, std::tuple<Args...>>::type
type;
constexpr bool is_iterable_v
constexpr bool is_iterator_v
Checks whether condition holds for all types passed as variadic template.
std::tuple_element< i, std::tuple< Args... > >::type type
A typetrait that is std::true_type iff std::begin() and std::end() can be called on type T.
A typetrait that is std::true_type iff the given type has the iterator traits.