end_impl.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  3. Copyright (c) 2005-2006 Dan Marsden
  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(BOOST_FUSION_END_IMPL_31122005_1237)
  8. #define BOOST_FUSION_END_IMPL_31122005_1237
  9. #include <boost/fusion/support/config.hpp>
  10. #include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
  11. #include <boost/mpl/end.hpp>
  12. #include <boost/type_traits/add_const.hpp>
  13. namespace boost { namespace fusion
  14. {
  15. struct mpl_sequence_tag;
  16. namespace extension
  17. {
  18. template <typename Tag>
  19. struct end_impl;
  20. template <>
  21. struct end_impl<mpl_sequence_tag>
  22. {
  23. template <typename Sequence>
  24. struct apply
  25. {
  26. typedef typename mpl::end<
  27. typename remove_const<Sequence>::type
  28. >::type iterator;
  29. typedef mpl_iterator<iterator> type;
  30. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  31. static type
  32. call(Sequence)
  33. {
  34. return type();
  35. }
  36. };
  37. };
  38. }
  39. }}
  40. #endif