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);
} else {
regularProcess(line);
range.popFront;
}
}
Thanks.
so `front` is peek, and `popFront` is the pop action whose return
type is `void`, why we need two *separate* calls instead of just
let `popFront` return T (or do we have another function for
this)? i.e if the user forget `popFront`, it will prone to
infinite loop bug?