compile error while use `extern(C++, class)`

mogu via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 17 18:06:29 PDT 2016


 From spec (Interfacing to C++) 
https://dlang.org/spec/cpp_interface.html:

```
When mapping a D class onto a C++ struct, use extern(C++, struct) 
to avoid linking problems with C++ compilers (notably MSVC) that 
distinguish between C++'s class and struct when mangling. 
Conversely, use extern(C++, class) to map a D struct onto a C++ 
class.
```

But this compiles error. Please help, thanks.


More information about the Digitalmars-d-learn mailing list