end_impl.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*=============================================================================
  2. Copyright (c) 2009 Hartmut Kaiser
  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. #if !defined(BOOST_FUSION_NVIEW_END_IMPL_SEP_24_2009_0140PM)
  7. #define BOOST_FUSION_NVIEW_END_IMPL_SEP_24_2009_0140PM
  8. #include <boost/mpl/end.hpp>
  9. #include <boost/fusion/sequence/intrinsic/end.hpp>
  10. namespace boost { namespace fusion
  11. {
  12. struct nview_tag;
  13. template <typename Sequence, typename Pos>
  14. struct nview_iterator;
  15. namespace extension
  16. {
  17. template <typename Tag>
  18. struct end_impl;
  19. // Unary Version
  20. template <>
  21. struct end_impl<nview_tag>
  22. {
  23. template <typename Sequence>
  24. struct apply
  25. {
  26. typedef typename Sequence::index_type index_type;
  27. typedef nview_iterator<Sequence,
  28. typename mpl::end<index_type>::type> type;
  29. static type call(Sequence& s)
  30. {
  31. return type(s);
  32. }
  33. };
  34. };
  35. }
  36. }}
  37. #endif