123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- #ifndef BOOST_COMPUTE_DETAIL_IS_CONTIGUOUS_ITERATOR_HPP
- #define BOOST_COMPUTE_DETAIL_IS_CONTIGUOUS_ITERATOR_HPP
- #include <vector>
- #include <valarray>
- #include <boost/config.hpp>
- #include <boost/type_traits.hpp>
- #include <boost/utility/enable_if.hpp>
- namespace boost {
- namespace compute {
- namespace detail {
- template<class Iterator, class Enable = void>
- struct _is_contiguous_iterator : public boost::false_type {};
- template<class Iterator>
- struct _is_contiguous_iterator<
- Iterator,
- typename boost::enable_if<
- typename boost::is_same<
- Iterator,
- typename std::vector<typename Iterator::value_type>::iterator
- >::type
- >::type
- > : public boost::true_type {};
- template<class Iterator>
- struct _is_contiguous_iterator<
- Iterator,
- typename boost::enable_if<
- typename boost::is_same<
- Iterator,
- typename std::vector<typename Iterator::value_type>::const_iterator
- >::type
- >::type
- > : public boost::true_type {};
- template<class Iterator>
- struct _is_contiguous_iterator<
- Iterator,
- typename boost::enable_if<
- typename boost::is_same<
- Iterator,
- typename std::valarray<typename Iterator::value_type>::iterator
- >::type
- >::type
- > : public boost::true_type {};
- template<class Iterator>
- struct _is_contiguous_iterator<
- Iterator,
- typename boost::enable_if<
- typename boost::is_same<
- Iterator,
- typename std::valarray<typename Iterator::value_type>::const_iterator
- >::type
- >::type
- > : public boost::true_type {};
- template<class Iterator>
- struct _is_contiguous_iterator<
- Iterator,
- typename boost::enable_if<
- boost::is_pointer<Iterator>
- >::type
- > : public boost::true_type {};
- template<class Iterator, class Enable = void>
- struct is_contiguous_iterator :
- public _is_contiguous_iterator<
- typename boost::remove_cv<Iterator>::type
- > {};
- template<class Iterator>
- struct is_contiguous_iterator<
- Iterator,
- typename boost::enable_if<
- typename boost::is_void<
- typename Iterator::value_type
- >::type
- >::type
- > : public boost::false_type {};
- }
- }
- }
- #endif
|