Is there a skipOver function for InputRanges?

realhet real_het at hotmail.com
Tue Oct 8 07:14:28 UTC 2024


Hello,

I wanted to use skipOver on my input range, but I ran into an 
error that it needs a .save method in the range.

I can't give that because it's a generator function that catches 
yield()s, I can't save the state of that.

What I wanted to simplify is this:
```
void skipWhite()
{
   while(!scanner.empty && scanner.front.src.all!isWhite)
     scanner.popFront;
}
```

Is there a way to do it nicer with Phobos?
Or do I have to write a popFrontWhile() template function for 
this? (And try not to forget it's name in the future ;)


More information about the Digitalmars-d-learn mailing list