// Copyright Abel Sinkovics (abel@sinkovics.hu) 2014. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include #include #include #include #include "test_case.hpp" namespace { template struct returns { typedef T type; }; template struct gets_foo { typedef typename T::foo type; }; } BOOST_METAPARSE_TEST_CASE(accept) { using boost::metaparse::accept; using boost::metaparse::start; using boost::metaparse::string; using boost::metaparse::get_result; using boost::metaparse::get_position; using boost::metaparse::get_remaining; using boost::is_same; typedef string<'H','e','l','l','o'> s; // test_accept_is_metaprogramming_value BOOST_MPL_ASSERT(( is_same, accept::type> )); // test_accept_is_not_lazy BOOST_MPL_ASSERT(( is_same< accept, s, start>, accept, returns, returns >::type > )); // test_get_result_of_accept BOOST_MPL_ASSERT((is_same >::type>)); // test_get_remaining_of_accept BOOST_MPL_ASSERT((is_same >::type>)); // test_get_position_of_accept BOOST_MPL_ASSERT(( is_same >::type> )); }