proposition to std.range: SortedRange.indexOf(value)

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Dec 19 08:19:01 PST 2012


On 12/19/12 11:03 AM, Alexander Tankeev wrote:
> Hello, world.
>
> I find very useful and clean interface that provides SortedRange, but it
> was disappointing that it have binarySearch to answer does it
> .contains(value), but can't return the .indexOf(value). In my opinion it
> should be part of the interface.

What to return if there are several indexes for a value? That's why the 
more general lowerBound, upperBound, equalRange, and trisect are defined.

Andrei


More information about the Digitalmars-d mailing list