segmented_begin.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*=============================================================================
  2. Copyright (c) 2011 Eric Niebler
  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_SEGMENTED_BEGIN_HPP_INCLUDED)
  7. #define BOOST_FUSION_SEGMENTED_BEGIN_HPP_INCLUDED
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/sequence/intrinsic/detail/segmented_begin_impl.hpp>
  10. #include <boost/fusion/iterator/segmented_iterator.hpp>
  11. #include <boost/fusion/view/iterator_range.hpp>
  12. #include <boost/fusion/sequence/intrinsic/begin.hpp>
  13. #include <boost/fusion/sequence/intrinsic/end.hpp>
  14. #include <boost/fusion/sequence/intrinsic/empty.hpp>
  15. #include <boost/fusion/container/list/cons.hpp>
  16. namespace boost { namespace fusion { namespace detail
  17. {
  18. //auto segmented_begin( seq )
  19. //{
  20. // return make_segmented_iterator( segmented_begin_impl( seq, nil_ ) );
  21. //}
  22. template <typename Sequence, typename Nil_ = fusion::nil_>
  23. struct segmented_begin
  24. {
  25. typedef
  26. segmented_iterator<
  27. typename segmented_begin_impl<Sequence, Nil_>::type
  28. >
  29. type;
  30. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  31. static type call(Sequence& seq)
  32. {
  33. return type(
  34. segmented_begin_impl<Sequence, Nil_>::call(seq, Nil_()));
  35. }
  36. };
  37. }}}
  38. #endif