Struct default constructor - need some kind of solution for C++ interop

Ethan Watson via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 6 07:30:44 PDT 2016


On Tuesday, 6 September 2016 at 14:27:49 UTC, Lodovico Giaretta 
wrote:
> That's because it doesn't initialize (with static opCall) the 
> fields of SomeOtherClass, right? I guess that could be solved 
> once and for all with some template magic of the binding system.

Correct for the first part. The second part... not so much. Being 
all value types, there's nothing stopping you instantiating the 
example Mutex on the stack in a function in D - and no way of 
enforcing the user to go through a custom construction path 
either.


More information about the Digitalmars-d mailing list