VCCC  2024.05
VisualCamp Common C++ library
iterable.hpp
Go to the documentation of this file.
1 # /*
2 # * Created by YongGyu Lee on 2020/12/08.
3 # */
4 #
5 # ifndef VCCC_TYPE_TRAITS_ITERABLE_HPP
6 # define VCCC_TYPE_TRAITS_ITERABLE_HPP
7 #
9 
10 namespace vccc {
11 
25 template<typename T, typename = void>
26 struct is_iterator : std::false_type {};
27 
28 template<typename T>
29 struct is_iterator<T,
30  typename std::enable_if_t<
31  !std::is_same<
32  typename std::iterator_traits<T>::value_type,
33  void
34  >::value
35  >
36 > : std::true_type {
37 };
38 
39 template<typename T>
41 
42 
45 template<typename T>
46 struct is_iterable : disjunction<is_iterator<T>, std::is_pointer<T>> {};
47 
49 
50 } // namespace vccc
51 
52 # endif // VCCC_TYPE_TRAITS_ITERABLE_HPP
typename is_iterator< T >::type is_iterator_t
Definition: iterable.hpp:40
Definition: matrix.hpp:495
Definition: directory.h:12
Definition: disjunction.hpp:22
Definition: iterable.hpp:46
Definition: iterable.hpp:26