Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Can lamda's be attached to grammar rules? E.g.,
- x3::rule<class _desc> const _desc = "_desc";
- auto const _desc_def = *(char_ - eol);
- BOOST_SPIRIT_DEFINE(_desc);
- auto description = skip(blank) [
- *(_desc >> eol)
- ];
- auto process_desc = [&] (auto& ctx) {
- std::cout << _attr(ctx) << std::endl;
- };
- auto const input = description[process_desc];
- /*
- By doing this, I get this error ...
- test.cpp:48:42: required from here
- /usr/include/boost/spirit/home/x3/core/call.hpp:72:28: error: use of ‘auto boost::spirit::x3::detail::call(F, const Context&, mpl_::true_) [with F = parser::smf::<lambda(auto:1&)>; Context = boost::spirit::x3::context<boost::spirit::x3::attr_context_tag, boost::spirit::x3::unused_type, boost::spirit::x3::context<boost::spirit::x3::where_context_tag, boost::iterator_range<boost::spirit::basic_istream_iterator<char> >, boost::spirit::x3::context<boost::spirit::x3::rule_val_context_tag, const boost::spirit::x3::unused_type, boost::spirit::x3::context<boost::spirit::x3::parse_pass_context_tag, bool, boost::spirit::x3::unused_type> > > >; mpl_::true_ = mpl_::bool_<true>]’ before deduction of ‘auto’
- return detail::call(f, attr_context, is_callable<F(decltype(attr_contex
- ^
- */
Advertisement
Add Comment
Please, Sign In to add comment