1 #ifndef BOOST_METAPARSE_GETTING_STARTED_7_2_HPP 2 #define BOOST_METAPARSE_GETTING_STARTED_7_2_HPP 3 4 // Automatically generated header file 5 6 // Definitions before section 7.1 7 #include "7_1.hpp" 8 9 // Definitions of section 7.1 10 #include <boost/mpl/times.hpp> 11 12 template <class L, class R> struct eval_binary_op<L, '*', R> : boost::mpl::times<L, R>::type {}; 13 14 // query: 15 // eval_binary_op<boost::mpl::int_<3>, '*', boost::mpl::int_<4>>::type 16 17 using times_token = token<lit_c<'*'>>; 18 19 using exp_parser14 = 20 build_parser< 21 foldl_start_with_parser< 22 sequence<one_of<plus_token, minus_token, times_token>, int_token>, 23 int_token, 24 boost::mpl::quote2<binary_op> 25 > 26 >; 27 28 // query: 29 // exp_parser14::apply<BOOST_METAPARSE_STRING("2 * 3")>::type 30 31 // query: 32 // exp_parser14::apply<BOOST_METAPARSE_STRING("1 + 2 * 3")>::type 33 34 #endif 35 36