Opened 9 years ago
Last modified 9 years ago
#9114 new Bugs
Documentation examples not working
| Reported by: | Owned by: | Joel de Guzman | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | spirit |
| Version: | Boost 1.54.0 | Severity: | Problem |
| Keywords: | Cc: |
Description
Example of qi::phrase_parse (from this page):
// the following parses "1.0 2.0" into a pair of double
std::string input("1.0 2.0");
std::string::iterator strbegin = input.begin();
std::pair<double, double> p;
qi::phrase_parse(strbegin, input.end(),
qi::double_ >> qi::double_, // parser grammar
qi::space, // delimiter grammar
p);
and example of qi::parse (from this page):
// the following parses "(1.0, 2.0)" into a pair of double
std::string input("(1.0, 2.0)");
std::string::iterator strbegin = input.begin();
std::pair<double, double> p;
qi::parse(strbegin, input.end(),
'(' >> qi::double_ >> ", " >> qi::double_ >> ')', // parser grammar
p);
both produce compile error:
no matching function for call to 'std::pair<double, double>::pair(const double&)'
Compiled with gcc 4.7.3
Note:
See TracTickets
for help on using tickets.

I've found some misprints in documentation, you can get patch from github: