How to check at compile time if Default Constructor for a class exists?

Bottled Gin via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 1 07:55:53 PST 2016


> You might be able to just do `static if(__traits(compiles, new 
> YourClass()))` and if it returns true then figure it does.

That gives me a false positive if a defined constructor has 
default value for all its arguments.


More information about the Digitalmars-d mailing list