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).
          • Re: nogc v0.5... ag0aep6g via Digitalmars-d-announce
            • Re: nogc... ag0aep6g via Digitalmars-d-announce
            • Re: nogc... Meta via Digitalmars-d-announce
            • Re: nogc... Atila Neves via Digitalmars-d-announce
              • Re: ... Paolo Invernizzi via Digitalmars-d-announce
              • Re: ... Atila Neves via Digitalmars-d-announce
              • Re: ... Paolo Invernizzi via Digitalmars-d-announce
              • Re: ... ag0aep6g via Digitalmars-d-announce
              • Re: ... Atila Neves via Digitalmars-d-announce
              • Re: ... ag0aep6g via Digitalmars-d-announce
              • Re: ... Atila Neves via Digitalmars-d-announce
              • Re: ... ag0aep6g via Digitalmars-d-announce
              • Re: ... Valeriy Fedotov via Digitalmars-d-announce
              • Re: ... ag0aep6g via Digitalmars-d-announce
  • Re: nogc v0.5.0 - DIP1008 work... Mike Franklin via Digitalmars-d-announce

Reply via email to