H1 2015 - C++ integration

Guillaume Chatelet via Digitalmars-d digitalmars-d at puremagic.com
Sat Feb 14 07:28:37 PST 2015


On Friday, 13 February 2015 at 18:47:53 UTC, Daniel Murphy wrote:
> "Guillaume Chatelet"  wrote in message 
> news:gvnxmwplwkyfrydwrulq at forum.dlang.org...
>
>> I'm not sure I get your point. In C++ classes without vtables 
>> are exactly like structs. Also I don't see any difference 
>> between a struct or a class name mangling on Gnu Linux.
>>
>> class/struct S{};
>> S foo();
>>
>> foo gets mangled "_Z3foov" if S is a struct or a class.
>>
>> What did I miss ? Do you have compelling examples ?
>
> This is not a good example, because the return type is clearly 
> not mangled into the function name.  (Because you can't 
> overload on return type.)
>
> void foo(S); should show the problem with some mangling schemes.

You're absolutely right, my bad.

class/struct S {};
void foo(S s){}

foo gets mangled "_Z3foo1S" if S is a struct or a class.


More information about the Digitalmars-d mailing list