begin_impl.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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_BEGIN_IMPL_SEP_23_2009_1036PM)
  7. #define BOOST_FUSION_NVIEW_BEGIN_IMPL_SEP_23_2009_1036PM
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/sequence/intrinsic/begin.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 begin_impl;
  19. template<>
  20. struct begin_impl<nview_tag>
  21. {
  22. template<typename Sequence>
  23. struct apply
  24. {
  25. typedef typename Sequence::index_type index_type;
  26. typedef nview_iterator<Sequence,
  27. typename result_of::begin<index_type>::type> type;
  28. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  29. static type call(Sequence& s)
  30. {
  31. return type(s);
  32. }
  33. };
  34. };
  35. }
  36. }}
  37. #endif