How do I call a C++ struct default constructor from D?

Atila Neves via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Feb 7 02:15:09 PST 2017


I can declare a C++ struct like so:

extern(C++, mynamespace)
struct Foo {
    //...
}

But... I don't want to repeat the initialisation code for that 
struct's default constructor. I can't declare one in D because D 
doesn't allow default constructors for structs. What's my way 
out? Thanks,

Atila


More information about the Digitalmars-d-learn mailing list