end_impl.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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/iterator/basic_iterator.hpp>
  9. #include <boost/type_traits/rank.hpp>
  10. #include <boost/type_traits/extent.hpp>
  11. namespace boost { namespace fusion { namespace extension
  12. {
  13. template <typename>
  14. struct end_impl;
  15. template <>
  16. struct end_impl<po_array_tag>
  17. {
  18. template <typename Seq>
  19. struct apply
  20. {
  21. typedef
  22. basic_iterator<
  23. po_array_iterator_tag
  24. , random_access_traversal_tag
  25. , Seq
  26. , extent<Seq,rank<Seq>::value-1>::value
  27. >
  28. type;
  29. static type
  30. call(Seq& seq)
  31. {
  32. return type(seq,0);
  33. }
  34. };
  35. };
  36. }}}
  37. #endif