[Issue 18347] stdx.allocator dispose should be @safe

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 1 17:26:07 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18347

Seb <greensunny12 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Seb <greensunny12 at gmail.com> ---
Ah sorry I was confusing things - I was wanted to refer to ScopedAllocator, but
that already works:

---
void main() @safe
{
    import std.experimental.allocator.mallocator : Mallocator;
    import std.experimental.allocator.building_blocks.scoped_allocator :
ScopedAllocator;
    import std.experimental.allocator : makeArray, dispose;
    alias alloc = Mallocator.instance;
    auto p = alloc.makeArray!ubyte(20);
}
---

https://run.dlang.io/is/xJBFaA

Sorry

--


More information about the Digitalmars-d-bugs mailing list