On Tuesday, 2 September 2014 at 10:22:49 UTC, monarch_dodra wrote:
the fastest way to do this?
Are you talking about constraints, or implementation of
safeSkipOver?
The constraint.
Hum... Are you writing this function because skipOver will
actually fail? AFAIK, it shouldn't. We should fix skipOver...
Yes, I'm writing this wrapper because call to r.front in
bool skipOver(alias pred = "a == b", R, E)(ref R r, E e)
if (is(typeof(binaryFun!pred(r.front, e))))
{
if (!binaryFun!pred(r.front, e))
return false;
r.popFront();
return true;
}
fails when r is empty.
It believe it should be
if (r.empty || !binaryFun!pred(r.front, e))
right? Should I do a PR?