I'm trying to parse a string to a utree using the following code:
void Parse(const std::string& testString, const MyGrammar<const char*>& parser)
{
char const* first = testString.c_str();
char const* last = &first[testString.size()];
boost::spirit::utree tree;
boost::spirit::qi::parse(first,last,parser,tree);
std::cout << "tree: " << tree << '\n';
}
where MyGrammar is
namespace spirit = boost::spirit;
class MyGrammar : public spirit::qi::grammar<Iterator, spirit::utree(), spirit::qi::space_type>
{
...
}
But this fails to compile with the following message:
Error 1 error C2664: 'bool boost::function4::operator ()(T0,T1,T2,T3) const' : cannot convert parameter 4 from 'const boost::spirit::unused_type' to 'const boost::spirit::qi::char_class ' c:\program files\etas\etasadlib\boost\1.49.0\include\boost\spirit\home\qi\nonterminal\rule.hpp 303 MyGrammarTest
Can someone help me out?