Why extern variables and functions within template/struct/class have a D mangling

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed May 8 02:56:04 PDT 2013


On 5/8/13, Dicebot <m.strashun at gmail.com> wrote:
> Because they have namespace (class namespace) and can't be
> mangled according to C rules. Exactly your example. You can't
> have two "foo"'s there but any other naming scheme IS NOT C
> mangling but some weird abomination that pretends to be it. Thus
> it is a compile-time error.

Right, you may not be able to statically link with it but it's still a
calling convention, so it's useful (for callbacks).


More information about the Digitalmars-d mailing list