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

Mark Isaacson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 2 16:39:30 PDT 2014


Did some thinking: Realized that the appropriate mechanism to 
express that A and B are two ways of representing the same thing 
is to do so via opCast. I had not considered this option 
carefully initially as I am translating someone else's C++ code 
to D and hoped that they had used the appropriate representations 
on the C++ side.

I added the appropriate code to permit casting and I was then 
able to get the desired code-reuse and template constraints.

Accordingly, I no longer need an answer to my second question 
unless someone knows of a more idiomatic way to get the same 
results.


More information about the Digitalmars-d-learn mailing list