@safe containers with std.experimental.allocator

bitwise via Digitalmars-d digitalmars-d at puremagic.com
Wed Jan 25 09:26:01 PST 2017


On Tuesday, 24 January 2017 at 19:38:31 UTC, bitwise wrote:
>
> I would, but I'm not sure I can use these allocators.
>
> Ran into this:
> http://forum.dlang.org/post/akohcwiotlcrodemhexx@forum.dlang.org
>
> As stated in that thread, I can mark the member instance of the 
> allocator in the container as 'shared', but then, if I use an 
> allocator _without_ 'shared' methods, I get errors as well.
>
> I'm not sure if there is a solution for this, but at this 
> point, I try to just avoid 'shared' at all costs. The fact that 
> Mallocator is thread safe should not stop me from using it in a 
> non-thread safe class, but it does.

So I guess there is no solution for this?

I've written my own allocators at this point, which is not 
something I did with great joy.


More information about the Digitalmars-d mailing list