Equality of ForwardRanges

Tobias Pankrath tobias at pankrath.net
Sun Oct 28 12:42:29 PDT 2012


Given:

void foo(Range)(Range fwdR)
    if(isForwardRange!Range)
{
     auto tmp = fwdR.save;
     assert(tmp == fwdR);
}

May I assume that the assert holds for generic forward range 
types?

Reason: I try to write an algorithm, that is easily implementable 
with random access ranges, but to make it work with forward 
ranges I need a comparison similar to the one above.


More information about the Digitalmars-d mailing list