end_impl.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_END_IMPL_07172005_0828)
  8. #define FUSION_END_IMPL_07172005_0828
  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 end_impl;
  24. template <>
  25. struct end_impl<cons_tag>
  26. {
  27. template <typename Sequence>
  28. struct apply
  29. {
  30. typedef cons_iterator<
  31. typename mpl::if_<is_const<Sequence>, nil_ const, nil_>::type>
  32. type;
  33. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  34. static type
  35. call(Sequence&)
  36. {
  37. return type();
  38. }
  39. };
  40. };
  41. }
  42. }}
  43. #endif