Sorted Array (Container) Type

Tejas notrealemail at gmail.com
Mon Nov 14 00:29:40 UTC 2022


On Sunday, 13 November 2022 at 18:51:09 UTC, Siarhei Siamashka 
wrote:
> On Saturday, 12 November 2022 at 14:07:46 UTC, Per Nordlöw 
> wrote:
>> Have anybody created a wrapper container
>>
>> ```d
>> struct Sorted(ArrayLike, alias lessThanPred)
>> ```
>>
>>
>> that wraps an array-like type `ArrayLike` so that it's always 
>> sorted according to the binary predicate `lessThanPred`?
>
> I'm not sure if these are a good fit for what you need, but 
> have you checked 
> https://dlang.org/phobos/std_container_rbtree.html and 
> https://dlang.org/phobos/std_container_binaryheap.html ?

He said on Discord he want contiguous data structure, rbtree 
allocates too much


More information about the Digitalmars-d-learn mailing list