Boost.Spirit.Qi - Errors at the beginning of a rule
问题 How would I detect an error at the start of a rule? For example, consider the Mini XML example included in the docs. If I feed the parser something like: <element>this is an error<element> Then I get: Error! Expecting here: "" Error! Expecting here: "" Parsing failed. That's fine, but then consider feeding it: element>this is an error</element> And I get the very generic and not so useful: Parsing failed. How could I modify the rule to report the error in an informative way? 回答1: You'd want