const(Class) is mangled as Class const* const

kinke via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 28 06:18:57 PDT 2017


On Tuesday, 28 March 2017 at 12:55:02 UTC, deadalnix wrote:
> On Tuesday, 28 March 2017 at 08:30:43 UTC, kinke wrote:
>> What I don't get is why it's considered important to have a 
>> matching C++ mangling for templates across D and C++ - what 
>> for? I only care about mangling wrt.
>
> If you still think this is a mangling problem, please reread my 
> first response in this thread.

You don't seem to get my point, I don't know why it's apparently 
that hard. I don't want to be able to express both `const T* 
const` AND `const T*` in C++, I only want D's const(Object) 
mangling to express solely the former instead of the latter, as 
there's no use for the double-const, except maybe for templates 
as Walter pointed out, but there's no template interop between D 
and C++ anyway.

I absolutely don't care that it's inconsistent to what a D 
const(Object) reference actually is (both pointer and class 
const) when passing such a thing BY VALUE to C++. As I said, 
there's no C++ analogon for D object references, so why not have 
it be a special case in the C++ mangler...


More information about the Digitalmars-d mailing list