Boost logo

Boost Users :

Subject: Re: [Boost-users] iterators must go
From: Daniel James (daniel_james_at_[hidden])
Date: 2009-05-15 17:15:20

2009/5/13 Scott McMurray <[hidden]>:
> 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());
> How do you do that nicely with ranges, when he has find returning a
> range?  (Since right now, it implicitly actually returns 2 ranges.)

He claims that D's stdlib is a superset of the STL. It certainly
supports this case:

    import std.algorithm;
    import std.stdio;

    void main() {
        int[] arr = [4,5,6,7,1,2,3];
        bringToFront(arr, find(arr, 1));
        assert(arr == [1,2,3,4,5,6,7]);


The relevant point is that bringToFront's first range can step over
the second range.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at