C++ binding issues with C++ function returning a simple POD struct.

evilrat via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 22 01:25:45 PDT 2017


On Monday, 22 May 2017 at 08:03:07 UTC, ParticlePeter wrote:
>
> No, no, this (other) way around :-), still C++ to D. It 
> actually works btw:
>
> -------- HACK -------------------
> // original C++
> ImVec2 GetCursorPos();
>
> // C++ helper
> void GetCursorPos(ImVec2& result) {
>   result = GetCursorPos();
> }
>
> // bind with
> extern(C++)
> void GetCursorPos(ref ImVec2 result);
> ----------------------------------

My proposed hack is purely D side though O_-


More information about the Digitalmars-d-learn mailing list