
on Fri Jul 24 2009, Mathias Gaunard <mathias.gaunard-AT-ens-lyon.org> wrote:
To be clearer, let's suppose I want to do the following with Alexandresuc ranges.
range r = myrange; for(range r = myrange; !r.empty(); r.popFront()) { if(is_word_boundary(???, r)) { // ... } }
"???" could be something like complement(myrange, r) but I don't see how to implement that generically other than linearly, and still that would require a primitive to compare ranges.
the iterator solution, however, is straightforward:
for(iterator it = myrange.begin(); it != myrange.end(); ++it) { if(is_word_boundary(myrange.begin(), it, myrange.end()) { // ... } }
That's a good question. -- Dave Abrahams BoostPro Computing http://www.boostpro.com