Postblit not invokable with MyStruct(MyStruct()); ?

Mark Isaacson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat May 3 12:57:34 PDT 2014


> What actually fails is the initialization of 'a'.
> Add another
>
>    this(A a) { /* Stuff */ }
>
> constructor to the 'A' struct, and it will work.
>
>
> And, yes, the missing cpctors are a language problem.
>
> artur


Thanks. Yeah, I figured I could do that, I was just hoping that I 
could leverage the postblit.

Ultimately my answer to my second question became: "Calling the 
postblit directly is far too low level, just use std.conv.to 
instead". to!A(x) did exactly the right thing (without any 
modification of the original classes I think).


More information about the Digitalmars-d-learn mailing list