I use to parse lines from a file by writing,
ifstream input(filename);
for (string line; getline(input, line); /**/)
do_something_with(line);
...
but is it possible to elegantly (or with some boost
magic) convert it into a more terse form with range-based for loop, i.e. does something like getline_range
in an example below exist?
for (const auto& line : getline_range(ifstream(filename)))
do_something_with(line);
...