On Monday, 27 May 2019 at 10:31:10 UTC, ag0aep6g wrote:
On 27.05.19 12:06, Atila Neves wrote:
No, and I guess it can't. I'm trying to figure out what the
implications are. Can Vector only be @safe for Mallocator? Is
it possible to write a @safe Vector at all without having to
force the allocator to be @safe?
For @safe allocators, Vector can be @safe.
For specific @system allocators, like Mallocator, you can make
special @trusted cases in Vector.
For generic @system allocators, Vector cannot be @safe (or
@trusted).
It's ugly but would work. Right now I don't think I can do any
better than to follow your suggestion, but I predict many
beard-stroking walks for me along Lake Geneva in the near future.
I'd be nice if I could detect at compile-time that it's not just
Mallocator but an allocator that's built using it as well (e.g.
FallBackAllocator).