C++ template name mangling

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 15 12:53:29 PDT 2014


Currently, D supports:

1. C++ function name mangling
2. C++ namespace name mangling
3. C++ class field and vtbl[] layout
4. C++ function calling conventions

But what is missing is name mangling to match C++ templates. This makes it 
awkward and tedious to construct a D interface to a C++ template.

Andrei has proposed that D support, for templates declared within an extern(C++) 
block, C++ name mangling. This should not be difficult, it should not break any 
existing D source code, and will enable limited interaction with C++ templates 
from D.

One nice side benefit is that no other language offers such support, and given 
the increasing ubiquity of C++ template use, it would give us a nice leg up.


More information about the Digitalmars-d mailing list