end_impl.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*=============================================================================
  2. Copyright (c) 2010 Christopher Schmidt
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #ifndef BOOST_FUSION_ADAPTED_ARRAY_END_IMPL_HPP
  7. #define BOOST_FUSION_ADAPTED_ARRAY_END_IMPL_HPP
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/iterator/basic_iterator.hpp>
  10. #include <boost/type_traits/rank.hpp>
  11. #include <boost/type_traits/extent.hpp>
  12. namespace boost { namespace fusion { namespace extension
  13. {
  14. template <typename>
  15. struct end_impl;
  16. template <>
  17. struct end_impl<po_array_tag>
  18. {
  19. template <typename Seq>
  20. struct apply
  21. {
  22. typedef
  23. basic_iterator<
  24. po_array_iterator_tag
  25. , random_access_traversal_tag
  26. , Seq
  27. , extent<Seq,rank<Seq>::value-1>::value
  28. >
  29. type;
  30. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  31. static type
  32. call(Seq& seq)
  33. {
  34. return type(seq,0);
  35. }
  36. };
  37. };
  38. }}}
  39. #endif