Boost logo

Boost Users :

Subject: Re: [Boost-users] iterators must go
From: Louis Lavery (Louis_at_[hidden])
Date: 2009-05-13 03:28:49


Scott McMurray wrote:
> On Sun, May 10, 2009 at 09:24, Neal Becker <ndbecker2_at_[hidden]> wrote:
>> Interesting presentation:
>>
>> http://www.boostcon.com/site-
>> media/var/sphene/sphwiki/attachment/2009/05/08/iterators-must-go.pdf
>>
>
> Very persuasive, but it's careful to touch only the examples that look
> nice. Note, for example, that every range was a whole container.
>
> The three-iterators part was somewhat handwaved-over as well. Take
> this bit of current code, for example:
>
> auto i = find(c.begin(), c.end(), some_pred());
> rotate(c.begin(), i, c.end());
>

This is just a guess, but I'd be disappointed if it's
not something like this...

Range const r1... // r1 = [b,e)

Range const r2 = find(r1,pred); // r2 = [i,e)

Range const r3 = r1 - r2; // r3 = [b,i)

Range const rot = r2 + r3; // rot = [i,e) + [b,i)

Louis.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net