pop_back.cpp 1013 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #include <boost/metaparse/config.hpp>
  6. #if BOOST_METAPARSE_STD >= 2011
  7. # include <boost/metaparse/v1/cpp11/impl/pop_back.hpp>
  8. #else
  9. # include <boost/metaparse/v1/cpp98/impl/pop_back.hpp>
  10. #endif
  11. #include <boost/metaparse/string.hpp>
  12. #include <boost/mpl/equal_to.hpp>
  13. #include <boost/mpl/char.hpp>
  14. #include <boost/mpl/assert.hpp>
  15. #include "test_case.hpp"
  16. BOOST_METAPARSE_TEST_CASE(pop_back)
  17. {
  18. using boost::metaparse::v1::impl::pop_back;
  19. using boost::metaparse::string;
  20. using boost::mpl::equal_to;
  21. using boost::mpl::char_;
  22. typedef string<'h','e','l','l','o'> hello;
  23. // test_pop_back
  24. BOOST_MPL_ASSERT((equal_to<string<'h','e','l','l'>, pop_back<hello>::type>));
  25. // test_pop_back_one_element
  26. BOOST_MPL_ASSERT((equal_to<string<>, pop_back<string<'x'> >::type>));
  27. }