is_device_iterator.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //---------------------------------------------------------------------------//
  2. // Copyright (c) 2013-2014 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_TYPE_TRAITS_IS_DEVICE_ITERATOR_HPP
  11. #define BOOST_COMPUTE_TYPE_TRAITS_IS_DEVICE_ITERATOR_HPP
  12. #include <boost/type_traits/integral_constant.hpp>
  13. namespace boost {
  14. namespace compute {
  15. /// Meta-function returning \c true if \c Iterator is a device-iterator.
  16. ///
  17. /// By default, this function returns false. Device iterator types (such as
  18. /// buffer_iterator) should specialize this trait and return \c true.
  19. ///
  20. /// For example:
  21. /// \code
  22. /// is_device_iterator<buffer_iterator<int>>::value == true
  23. /// is_device_iterator<std::vector<int>::iterator>::value == false
  24. /// \endcode
  25. template<class Iterator>
  26. struct is_device_iterator : boost::false_type {};
  27. /// \internal_
  28. template<class Iterator>
  29. struct is_device_iterator<const Iterator> : is_device_iterator<Iterator> {};
  30. } // end compute namespace
  31. } // end boost namespace
  32. #endif // BOOST_COMPUTE_TYPE_TRAITS_IS_DEVICE_ITERATOR_HPP