Compiler hints, inlining and syntax consistency

Jakob Ovrum jakobovrum at gmail.com
Sat Dec 28 12:00:32 PST 2013


On Saturday, 28 December 2013 at 19:24:19 UTC, Ola Fosheim 
Grøstad wrote:
> On Saturday, 28 December 2013 at 19:20:15 UTC, Jakob Ovrum 
> wrote:
>> For array literals it's not such a bad idea, and was recently 
>> topical in the assessment of `std.algorithm.among`[1]. However,
>
> It is not a bad idea for sorted arrays either, when you think 
> about it: O(log n)

It could be added to `std.range.SortedRange`. For element type T, 
it could return T* when the underlying range has write access, 
and bool otherwise.

SortedRange needs work anyway; for one, I always wanted `find` on 
a sorted range to do binary search seamlessly...


More information about the Digitalmars-d mailing list