[Issue 16117] std.experimental.allocator does not work with non default constructible types

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jun 3 06:29:43 PDT 2016


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

--- Comment #2 from Andrei Alexandrescu <andrei at erdani.com> ---
Good point. Should work if the constructor is passed some argument:

import std.experimental.allocator;
struct Foo{
    @disable this();
    this(int) {}
}
auto foos = theAllocator.makeArray!Foo(100, 42);

--


More information about the Digitalmars-d-bugs mailing list