Interfacing D to existing C++ code

Daniel Murphy via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Thu Jan 29 20:09:01 PST 2015


"Walter Bright"  wrote in message news:maed4o$2da6$1 at digitalmars.com...

> >
> > So constructors and destructors are mangled 'a la D' instead of the C++ 
> > way.
>
> Please post this to bugzilla.

The problems with constructors go beyond mangling, so the current forced D 
mangling is intentional to prevent wrong-code bugs.

An approach that currently works is porting the code to D, being careful to 
exactly match the layout and functionality.  When done right, this allows 
templated types to be constructed with any type in either language and 
passed back and forth without problems.

This is what I've done for dmd's Array<T> in ddmd. 



More information about the Digitalmars-d-announce mailing list