std.experimental.collection.functional.slist

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 19 06:36:26 PDT 2015


On 6/19/15 4:51 AM, Ivan Timokhin wrote:
> A couple of thoughts:
>
> 1. It seems that an allocator is a public field of SList. Should it be so? What
> happens if someone changes an allocator while the list holds nodes allocated
> with the old one?

Good point. Made private.

> 2. Only dynamic allocator customisation is supported (unlike C++ containers). Is
> this deliberate?

Yes; I think C++'s approach to allocators didn't go over well, and part 
of the problem (though not all) is that allocators are associated with 
the type they allocate.

> 3. Shouldn't `front` functions be const?

Good point. Made const.


Andrei


More information about the Digitalmars-d mailing list