On Tuesday, 24 October 2017 at 11:37:42 UTC, Per Nordlöw wrote:
On Tuesday, 24 October 2017 at 07:56:34 UTC, Biotronic wrote:
struct SuppressPostblit(T)
{
// Disguise T as a humble array.
private ubyte[T.sizeof] _payload;
...
A bit too hackish for my taste, but does the job still.
On Tuesday, 24 October 2017 at 07:56:34 UTC, Biotronic wrote:
struct SuppressPostblit(T)
{
// Disguise T as a humble array.
private ubyte[T.sizeof] _payload;
...
A bit too hackish for my taste, but does the job still.
Thanks.
On Tuesday, 24 October 2017 at 07:33:43 UTC, Per Nordlöw wrote:
If I have a `struct X` (container in my case) with disabled
copying (postblit) and instead a .dup property, is it somehow
possible, unsafe or not, to have `X` as a member of another
`struct Y` with an enabled copy constructor
If I have a `struct X` (container in my case) with disabled
copying (postblit) and instead a .dup property, is it somehow
possible, unsafe or not, to have `X` as a member of another
`struct Y` with an enabled copy constructor which calls `X.dup`?