begin_impl.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  3. Copyright (c) 2005 Eric Niebler
  4. Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. ==============================================================================*/
  7. #if !defined(FUSION_BEGIN_IMPL_07172005_0824)
  8. #define FUSION_BEGIN_IMPL_07172005_0824
  9. #include <boost/fusion/support/config.hpp>
  10. #include <boost/mpl/if.hpp>
  11. #include <boost/type_traits/is_const.hpp>
  12. namespace boost { namespace fusion
  13. {
  14. struct nil_;
  15. struct cons_tag;
  16. template <typename Car, typename Cdr>
  17. struct cons;
  18. template <typename Cons>
  19. struct cons_iterator;
  20. namespace extension
  21. {
  22. template <typename Tag>
  23. struct begin_impl;
  24. template <>
  25. struct begin_impl<cons_tag>
  26. {
  27. template <typename Sequence>
  28. struct apply
  29. {
  30. typedef cons_iterator<Sequence> type;
  31. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  32. static type
  33. call(Sequence& t)
  34. {
  35. return type(t);
  36. }
  37. };
  38. };
  39. }
  40. }}
  41. #endif