begin_impl.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  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(FUSION_BEGIN_IMPL_05062005_0903)
  7. #define FUSION_BEGIN_IMPL_05062005_0903
  8. namespace boost { namespace fusion
  9. {
  10. struct filter_view_tag;
  11. template <typename Category, typename First, typename Last, typename Pred>
  12. struct filter_iterator;
  13. namespace extension
  14. {
  15. template <typename Tag>
  16. struct begin_impl;
  17. template <>
  18. struct begin_impl<filter_view_tag>
  19. {
  20. template <typename Sequence>
  21. struct apply
  22. {
  23. typedef typename Sequence::first_type first_type;
  24. typedef typename Sequence::last_type last_type;
  25. typedef typename Sequence::pred_type pred_type;
  26. typedef typename Sequence::category category;
  27. typedef filter_iterator<category, first_type, last_type, pred_type> type;
  28. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  29. static type
  30. call(Sequence& s)
  31. {
  32. return type(s.first());
  33. }
  34. };
  35. };
  36. }
  37. }}
  38. #endif