const(Class) is mangled as Class const* const

Benjamin Thaut via Digitalmars-d digitalmars-d at puremagic.com
Sun Mar 26 10:41:57 PDT 2017


On Sunday, 26 March 2017 at 14:30:00 UTC, deadalnix wrote:
>
> It's consistent. D's const is transitive, and D doesn't allow 
> you to specify const on the indirection of a reference type. So 
> there is no problem on the C++ mangling side of things, but, 
> arguably, there is one in D's sementic, that isn't new.

I disagree. When binding C++ code to D I don't care about D's 
const rules. I care about the C++ const rules. There are 
thousands of C++ libraries out there that can't be bound to D 
because they use const Class* instead of const Class* const. So 
in my eyes there is definitly something wrong with the C++ 
mangling of D.




More information about the Digitalmars-d mailing list