On Thursday, 27 April 2017 at 15:47:38 UTC, Alex wrote:
struct S
{
@disable this();
@disable this(this);
this(size_t dummy){}
}
Given a struct with an explicit constructor and a postblit. How
to make an array of it?
You mean with a disabled default ctor and postblit? You can't
with built-in arrays. They expect that elements can be
default-constructed and copied. Even std.container.Array in its
current implementation won't help you there.
The only way to get around that is to devise your own array type
that carefully deals with uninitialized storage and uses
emplace/move/moveEmplace to store elements.