pop_front.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef BOOST_METAPARSE_V1_CPP98_IMPL_POP_FRONT_HPP
  2. #define BOOST_METAPARSE_V1_CPP98_IMPL_POP_FRONT_HPP
  3. // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #include <boost/metaparse/v1/cpp98/fwd/string.hpp>
  8. #include <boost/preprocessor/repetition/enum_params.hpp>
  9. #include <boost/preprocessor/repetition/repeat_from_to.hpp>
  10. namespace boost
  11. {
  12. namespace metaparse
  13. {
  14. namespace v1
  15. {
  16. namespace impl
  17. {
  18. template <class S>
  19. struct pop_front;
  20. #ifdef BOOST_METAPARSE_POP_FRONT
  21. # error BOOST_METAPARSE_POP_FRONT already defined
  22. #endif
  23. #define BOOST_METAPARSE_POP_FRONT(z, n, unused) \
  24. BOOST_PP_COMMA_IF(BOOST_PP_DEC(n)) BOOST_PP_CAT(C, n)
  25. template < \
  26. BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, int C) \
  27. >
  28. struct
  29. pop_front<
  30. string<BOOST_PP_ENUM_PARAMS(BOOST_METAPARSE_LIMIT_STRING_SIZE, C)>
  31. > :
  32. string<
  33. BOOST_PP_REPEAT_FROM_TO(
  34. 1,
  35. BOOST_METAPARSE_LIMIT_STRING_SIZE,
  36. BOOST_METAPARSE_POP_FRONT,
  37. ~
  38. ),
  39. BOOST_NO_CHAR
  40. >
  41. {};
  42. #undef BOOST_METAPARSE_POP_FRONT
  43. }
  44. }
  45. }
  46. }
  47. #endif