GrPPI  0.3.1
Generic and Reusable Parallel Pattern Interface
iterator_traits.h
Go to the documentation of this file.
1 
21 #ifndef GRPPI_COMMON_ITERATOR_TRAITS_H
22 #define GRPPI_COMMON_ITERATOR_TRAITS_H
23 
24 namespace grppi{
25 
26 namespace internal {
27 
28 template<typename T, typename = void>
30 {
31  static constexpr bool value = false;
32 };
33 
34 template<typename T>
35 struct is_iterator<T, typename std::enable_if<!std::is_same<typename std::iterator_traits<T>::value_type, void>::value>::type>
36 {
37  static constexpr bool value = true;
38 };
39 
40 template<typename T, typename ...other_T>
42 {
43  static constexpr bool value = is_iterator<T>::value && are_iterators<other_T...>::value;
44 };
45 
46 template<typename T>
47 struct are_iterators<T>
48 {
49  static constexpr bool value = is_iterator<T>::value;
50 };
51 
52 }
53 
54 template <typename T>
56 
57 template <typename T>
58 using requires_iterator = std::enable_if_t<is_iterator<T>, int>;
59 
60 template<typename ...T>
62 
63 template<typename ...T>
64 using requires_iterators = std::enable_if_t<are_iterators<T...>, int>;
65 
66 }
67 
68 #endif
Definition: callable_traits.h:26
static constexpr bool value
Definition: iterator_traits.h:31
std::enable_if_t< are_iterators< T... >, int > requires_iterators
Definition: iterator_traits.h:64
STL namespace.
Definition: iterator_traits.h:29
constexpr bool is_iterator
Definition: iterator_traits.h:55
std::enable_if_t< is_iterator< T >, int > requires_iterator
Definition: iterator_traits.h:58
constexpr bool are_iterators
Definition: iterator_traits.h:61
Definition: iterator_traits.h:41