On Wednesday, 3 December 2014 at 21:02:05 UTC, Nordlöw wrote:
Have anybody written a generic automatically sorted range wrapper for RandomAccessRanges?

I guess

http://dlang.org/library/std/range/assumeSorted.html

should play a key role.

I see two typical variants:

- Direct: Always sorts on write() and modify()
- Lazy: Sorts lazily on read()

read() of course uses binarySearch

There was a relevant discussion about a month ago here:
http://forum.dlang.org/thread/uhfpppdslxdghycon...@forum.dlang.org

Otherwise, there's RedBlackTree, but I'm not aware of anything that works over any random-access range.

Reply via email to