Containers

Per Nordlöw per.nordlow at gmail.com
Wed Sep 1 10:12:23 UTC 2021


On Tuesday, 31 August 2021 at 23:24:57 UTC, deadalnix wrote:
> There is a ton of good work in there!

Yes, and I would really like it to come of use upstream. :)

> Do you agree with the direction explicated?

Yes. No objections afaict. All good points.

- CoW: sounds like the future direction in other languages such 
as Swift so no objections on that matter:
   - Should we enforce CoW or make it opt-in via storages fed as 
template parameters?
   - Will you be supporting

- Will you be using ranges or iterators?

- What about allocators? If you do can you please use 
std.experimental.allocator instead of stdx.allocator (used by 
emsi-containers and libdparse and dsymbol) is more than 2 years 
old now. std.experimental.allocator has received much love since, 
for instance `allocateZeroed` for the allocators that support it.

- An interesting emsi container that was new to me is 
`UnrolledList`. It's used extensively in dsymbol.

> I expected to focus on Vector/Set/Map initially. This should 
> serve most use case in practice.

You should probably use robin-hood hashing if you pick 
open-addressing. I'm not using that (yet) in my hash sets/maps. 
It has very good asymptotic complexity. You should probably have 
a look at the state-of-the-art robin-hood implementations in C++ 
aswell. To run my own C++-benchmark for containers you can do

     ./test

under

     benchmarks/containers-cxx

.


More information about the Digitalmars-d mailing list