Sorted Array (Container) Type

Siarhei Siamashka siarhei.siamashka at gmail.com
Sun Nov 13 18:51:09 UTC 2022


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 ?


More information about the Digitalmars-d-learn mailing list