C++ template name mangling

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 15 13:53:41 PDT 2014


On Fri, Aug 15, 2014 at 12:53:29PM -0700, Walter Bright via Digitalmars-d wrote:
> 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.

Sounds like an interesting idea.

What are the limits to this, though? Obviously, anything involving
D-only features can't possibly work, like alias parameters, typesafe
variadics, etc..


T

-- 
Customer support: the art of getting your clients to pay for your own incompetence.


More information about the Digitalmars-d mailing list