Opened 13 years ago
Closed 13 years ago
#3701 closed Bugs (wontfix)
Problems with lit() with one-character strings
Reported by: | Owned by: | Joel de Guzman | |
---|---|---|---|
Milestone: | Boost 1.42.0 | Component: | spirit |
Version: | Boost 1.41.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Hi,
I have a rule in the grammar defined as:
typedef qi::rule<Iterator, std::string(), qi::ascii::space_type> Rule;
Next I would like to define such a rule by:
Rule operation = lit("+") | lit("sum")
However, this will create errors. The problem seems to be the one-character string "+". If it is changed to e.g. "++" then there is no problem. It looks like "+" is interpreted as a single character and not as a string.
Note:
See TracTickets
for help on using tickets.
That's by design, use string("+") instead. Regards Hartmut