On Monday, 22 June 2020 at 20:49:55 UTC, mw wrote:
On Monday, 22 June 2020 at 20:46:30 UTC, mw wrote:
On Monday, 22 June 2020 at 20:00:50 UTC, Steven Schveighoffer wrote:
I wouldn't recommend it, instead do a while loop:

auto range = File(fn).byLine;

while(!range.empty)
{
   auto line = range.front;
   if(someCond(line)) {
        range.popFrontN(n);

I'm asking this, because here it need to be

either

range.popFrontN(n+1);

i.e. bug-prone

or

can be fixed by:
   auto line = range.front;
   range.popFront;  // pop immediately

of course.

Reply via email to