File indexing completed on 2025-12-16 09:44:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_COMPUTE_DETAIL_IS_CONTIGUOUS_ITERATOR_HPP
0012 #define BOOST_COMPUTE_DETAIL_IS_CONTIGUOUS_ITERATOR_HPP
0013
0014 #include <vector>
0015 #include <valarray>
0016
0017 #include <boost/config.hpp>
0018 #include <boost/type_traits.hpp>
0019 #include <boost/utility/enable_if.hpp>
0020
0021 namespace boost {
0022 namespace compute {
0023 namespace detail {
0024
0025
0026 template<class Iterator, class Enable = void>
0027 struct _is_contiguous_iterator : public boost::false_type {};
0028
0029
0030 template<class Iterator>
0031 struct _is_contiguous_iterator<
0032 Iterator,
0033 typename boost::enable_if<
0034 typename boost::is_same<
0035 Iterator,
0036 typename std::vector<typename Iterator::value_type>::iterator
0037 >::type
0038 >::type
0039 > : public boost::true_type {};
0040
0041
0042 template<class Iterator>
0043 struct _is_contiguous_iterator<
0044 Iterator,
0045 typename boost::enable_if<
0046 typename boost::is_same<
0047 Iterator,
0048 typename std::vector<typename Iterator::value_type>::const_iterator
0049 >::type
0050 >::type
0051 > : public boost::true_type {};
0052
0053
0054 template<class Iterator>
0055 struct _is_contiguous_iterator<
0056 Iterator,
0057 typename boost::enable_if<
0058 typename boost::is_same<
0059 Iterator,
0060 typename std::valarray<typename Iterator::value_type>::iterator
0061 >::type
0062 >::type
0063 > : public boost::true_type {};
0064
0065
0066 template<class Iterator>
0067 struct _is_contiguous_iterator<
0068 Iterator,
0069 typename boost::enable_if<
0070 typename boost::is_same<
0071 Iterator,
0072 typename std::valarray<typename Iterator::value_type>::const_iterator
0073 >::type
0074 >::type
0075 > : public boost::true_type {};
0076
0077
0078 template<class Iterator>
0079 struct _is_contiguous_iterator<
0080 Iterator,
0081 typename boost::enable_if<
0082 boost::is_pointer<Iterator>
0083 >::type
0084 > : public boost::true_type {};
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097 template<class Iterator, class Enable = void>
0098 struct is_contiguous_iterator :
0099 public _is_contiguous_iterator<
0100 typename boost::remove_cv<Iterator>::type
0101 > {};
0102
0103
0104 template<class Iterator>
0105 struct is_contiguous_iterator<
0106 Iterator,
0107 typename boost::enable_if<
0108 typename boost::is_void<
0109 typename Iterator::value_type
0110 >::type
0111 >::type
0112 > : public boost::false_type {};
0113
0114 }
0115 }
0116 }
0117
0118 #endif