pop_back.hpp 954 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef BOOST_METAPARSE_V1_CPP11_IMPL_POP_BACK_HPP
  2. #define BOOST_METAPARSE_V1_CPP11_IMPL_POP_BACK_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/cpp11/fwd/string.hpp>
  8. #include <boost/metaparse/v1/cpp11/impl/push_front_c.hpp>
  9. #include <boost/metaparse/v1/cpp11/impl/size.hpp>
  10. #include <boost/mpl/clear.hpp>
  11. namespace boost
  12. {
  13. namespace metaparse
  14. {
  15. namespace v1
  16. {
  17. namespace impl
  18. {
  19. template <class S>
  20. struct pop_back;
  21. template <char C>
  22. struct pop_back<string<C>> : boost::mpl::clear<string<C>> {};
  23. template <char C, char... Cs>
  24. struct pop_back<string<C, Cs...>> :
  25. push_front_c<typename pop_back<string<Cs...>>::type, C>
  26. {};
  27. }
  28. }
  29. }
  30. }
  31. #endif