C++ / Wrong function signature generated for reference parameter

Timoses timosesu at gmail.com
Fri May 4 14:49:35 UTC 2018


On Thursday, 3 May 2018 at 11:29:59 UTC, Robert M. Münch wrote:
> Not sure I understand this too. This is now what I get:
>
> DMD: public: unsigned int __cdecl b2d::Context2D::_begin(class 
> b2d::Image & __ptr64,class b2d::Context2D::InitParams const * 
> __ptr64 const) __ptr64
> LIB: public: unsigned int __cdecl b2d::Context2D::_begin(class 
> b2d::Image & __ptr64,class b2d::Context2D::InitParams const * 
> __ptr64) __ptr64
>
> So I somehow get some more const from D. This is the code I 
> used:
>
>    final uint _begin(ref Image image, const(InitParams) 
> initParams);
>
> Any idea how to solve this?
>
> I really like that I'm able to use C++ stuff from D but 
> interfacing the tow is a bit tedious... it would be great to be 
> able to write the C++ signature in the extern(C++) scope and 
> have it translated to the D equivalent internally.

Just as a note:
Related (if not to say duplicate) topic: 
https://forum.dlang.org/post/pch39e$nt7$1@digitalmars.com


More information about the Digitalmars-d-learn mailing list