What is the wrong with my C++ interfacing

drug drug2004 at bk.ru
Sun Mar 15 20:46:14 UTC 2020


15.03.2020 23:25, Ferhat Kurtulmuş пишет:
> On Sunday, 15 March 2020 at 20:21:57 UTC, drug wrote:
>> 15.03.2020 22:39, Ferhat Kurtulmuş пишет:
>>>
> 
>> What is the D version of `createSizeIntWH`? In C++ it returns a 
>> pointer but in D version it returns an instance.
> 
> extern(C++){
>      cv.Size_!int createSizeInt();
>      cv.Size_!int createSizeIntWH(int w, int h);
>      void deleteSizeInt(ref cv.Size_!int sz);
> }
> 

createSizeIntWH returns a pointer to instance, not an instance. Try:
cv.Size_!int* createSizeIntWH(int w, int h);


More information about the Digitalmars-d-learn mailing list