SortedRange and new docs for std.container

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Sep 8 09:11:26 PDT 2010


On 9/8/10 9:21 CDT, dsimcha wrote:
> == Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s article
>> Hello,
>> I just added SortedRange as discussed a while ago in this newsgroup. I
>> think it turned out pretty neat. Generally the range abstraction is
>> turning out to be very solid.
>> To get a SortedRange object for a given range r either call sort(r) if
>> you want to sort one, or assumeSorted(r) if you know that the range is
>> sorted already.
>> I've also fixed Zip (finally!) to get rid of a couple of dirty tricks.
>> It turns out that front()/front(v)/moveFront() are a correct way to
>> abstract proxy ranges like Zip is.
>> Search this documentation preview for "SortedRange" and "Zip":
>> http://erdani.com/d/phobos/std_range.html
>> http://erdani.com/d/phobos/std_algorithm.html
>> I've also improved the look of container requirements, check:
>> http://erdani.com/d/phobos/std_container.html
>> Comments and ideas are welcome.
>> Andrei
>
> One question:  Now that hasAt is gone, how does one use StoppingPolicy.longest
> properly?  IMHO StoppingPolicy.longest was never all that useful and should just
> be removed.

Hmmm, I was wrong to remove hasAt. Will add it back.

Andrei


More information about the Digitalmars-d mailing list