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:10:43 PDT 2016


On Tuesday, 6 September 2016 at 13:57:27 UTC, Lodovico Giaretta 
wrote:
> Of course I don't know which level of usability you want to 
> achieve, but I think that in this case your bind system, when 
> binding a default ctor, could use @disable this() and define a 
> factory method (do static opCall work?) that calls the C++ ctor.

static opCall doesn't work for the SomeOtherClass example listed 
in OP. @disable this() will hide the static opCall and the 
compiler will throw an error.

Somewhat related: googling "factory method dlang" doesn't provide 
any kind of clarity on what exactly is a factory method. 
Documentation for factory methods/functions could probably be 
improved on this front.


More information about the Digitalmars-d mailing list