|
Boost : |
Subject: Re: [boost] AlRangeExandrescu?
From: David Abrahams (dave_at_[hidden])
Date: 2009-07-24 13:27:10
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk