Ordered set container?

Dukc ajieskola at gmail.com
Tue Jan 29 08:22:41 UTC 2019


On Monday, 28 January 2019 at 17:18:52 UTC, Victor Porton wrote:
> I want "ordered set" container (like list or vector but with 
> the warranty of no duplicate elements).

The above answers are ordered, but if you want a type that's a 
simple sorted array, there's none at the standard library besides 
SortedRange, which you can't add to. (Mostly for a good reason, 
because adding elements to such an array after the initial 
sorting would be very slow).

https://github.com/nordlow/justd/blob/master/stdx/container/sorted.d
contains an implementation of such an array, but one cannot 
currently use it legally, because it is not licensed. I don't 
know if the author did that intentionally (Nordlöw, are you 
around?)


More information about the Digitalmars-d-learn mailing list