begin_impl.hpp 1.3 KB

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