begin_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_BEGIN_IMPL_31122005_1209)
  8. #define BOOST_FUSION_BEGIN_IMPL_31122005_1209
  9. #include <boost/fusion/support/config.hpp>
  10. #include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
  11. #include <boost/mpl/begin.hpp>
  12. #include <boost/type_traits/remove_const.hpp>
  13. namespace boost { namespace fusion {
  14. struct mpl_sequence_tag;
  15. namespace extension
  16. {
  17. template <typename Tag>
  18. struct begin_impl;
  19. template <>
  20. struct begin_impl<mpl_sequence_tag>
  21. {
  22. template <typename Sequence>
  23. struct apply
  24. {
  25. typedef typename mpl::begin<
  26. typename remove_const<Sequence>::type
  27. >::type iterator;
  28. typedef mpl_iterator<iterator> type;
  29. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  30. static type
  31. call(Sequence)
  32. {
  33. return type();
  34. }
  35. };
  36. };
  37. }
  38. }}
  39. #endif