iterator_traits.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //---------------------------------------------------------------------------//
  2. // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
  3. //
  4. // Distributed under the Boost Software License, Version 1.0
  5. // See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt
  7. //
  8. // See http://boostorg.github.com/compute for more information.
  9. //---------------------------------------------------------------------------//
  10. #ifndef BOOST_COMPUTE_DETAIL_ITERATOR_TRAITS_HPP
  11. #define BOOST_COMPUTE_DETAIL_ITERATOR_TRAITS_HPP
  12. #include <iterator>
  13. #include <boost/compute/detail/is_contiguous_iterator.hpp>
  14. #include <boost/compute/type_traits/is_device_iterator.hpp>
  15. namespace boost {
  16. namespace compute {
  17. namespace detail {
  18. template<class Iterator>
  19. struct iterator_traits : public std::iterator_traits<Iterator>
  20. {
  21. static const bool is_contiguous = is_contiguous_iterator<Iterator>::value;
  22. static const bool is_on_device = is_device_iterator<Iterator>::value;
  23. static const bool is_on_host = !is_on_device;
  24. };
  25. } // end detail namespace
  26. } // end compute namespace
  27. } // end boost namespace
  28. #endif // BOOST_COMPUTE_ITERATOR_TRAITS_HPP