Menu

#1 Convenience constructor

open
nobody
None
5
2012-12-06
2012-07-25
Mara
No

The generated parser.h file should include a convenience constructor of the following form:
parser(std::istream &in = std::cin):d_scanner(in){}

This would make parsing on any istream extremely easy (without additional work on the programmer's part). Since istreams represent everything from interactive terminals to file streams, the constructor serves as a great generic interface for the parser. In addition, the default constructor would still create a parser on std::cin.

Discussion