/Src/Dependencies/Boost/boost/proto/detail/pop_front.hpp

http://hadesmem.googlecode.com/ · C++ Header · 43 lines · 32 code · 4 blank · 7 comment · 0 complexity · d699d1311c35bd7c7f1f2755d9633c43 MD5 · raw file

  1. /*=============================================================================
  2. Copyright (c) 2001-2006 Joel de Guzman
  3. Copyright (c) 2008 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. #ifndef BOOST_PROTO_DETAIL_FUSION_POP_FRONT_EAH_01_22_2008
  8. #define BOOST_PROTO_DETAIL_FUSION_POP_FRONT_EAH_01_22_2008
  9. #include <boost/spirit/fusion/sequence/range.hpp>
  10. #include <boost/spirit/fusion/sequence/begin.hpp>
  11. #include <boost/spirit/fusion/sequence/end.hpp>
  12. #include <boost/spirit/fusion/iterator/next.hpp>
  13. namespace boost { namespace fusion
  14. {
  15. namespace meta
  16. {
  17. template <typename Sequence>
  18. struct pop_front
  19. {
  20. typedef
  21. range<
  22. typename next<
  23. typename begin<Sequence>::type
  24. >::type
  25. , typename end<Sequence>::type
  26. >
  27. type;
  28. };
  29. }
  30. template <typename Sequence>
  31. inline typename meta::pop_front<Sequence const>::type
  32. pop_front(Sequence const& seq)
  33. {
  34. typedef typename meta::pop_front<Sequence const>::type result;
  35. return result(fusion::next(fusion::begin(seq)), fusion::end(seq));
  36. }
  37. }}
  38. #endif