
If I have a grammar like this: typedef boost::proto::literalstd::string::type StringTerminal; typedef or_< StringTerminal, ...
Rule;
and I do this: checkMatch<Rule>(boost::proto::lit(std::string("str"))); checkMatch<Rule>(std::string("str")); checkMatch<Rule>("str"); where checkMatch is a wrapper around matches<>, the first line is the only one that passes. This is presumably because the string needs to be "protoized" and to match StringTerminal it has to be cast to std::string explicitly. This is rather ugly for constructs like this: term["str"] => term[lit(string("str"))] I would really rather not have to do the lit(string()) thing. Is there a good strategy to avoid this clutter? I could predefine literals like this: StringTerminal strlit = {{"str"}}. term[strlit] but that's a bit burdensome on the user. Would the same massaging be needed for, say, term + "strlit" Perhaps I can reformulate the grammar to avoid the cluttter by using constructs that promote constants to proper proto terminals. Any advice? Thanks! -Dave