const(Class) is mangled as Class const* const

kinke via Digitalmars-d digitalmars-d at puremagic.com
Mon Mar 27 15:12:38 PDT 2017


On Monday, 27 March 2017 at 22:04:55 UTC, Walter Bright wrote:
> On 3/27/2017 1:41 PM, kinke wrote:
>> Unfortunately, it's almost always the other way around - D 
>> code trying to
>> interop with one of the gazillions existing C++ libs, and 
>> nobody wants to
>> maintain his own fork with D-compatible glue interfaces. How 
>> often did you use
>> `const T *const` vs. `const T *` in your C++ headers? ;) I 
>> think this would be a
>> tiny change for D, breaking almost no code and well worth the 
>> reduction in
>> required 'flexibility on the C++ side'.
>
> It's made to work with:
>
>    const T
>
> which is the norm with C++ templates.

Okay, so how exactly do I bind D code to a C++ 
header-only-template library? I thought that in that case you 
need a full D translation anyway...


More information about the Digitalmars-d mailing list