On Monday, 25 May 2020 at 16:39:30 UTC, Mike Parker wrote:
On Monday, 25 May 2020 at 08:39:23 UTC, John Burton wrote:
I believe that in D *this* is a reference to the
object and not a pointer like in C++.
So I think that writing &this might be what you need?
No. A class reference is a pointer under the hood. Getting its
address will result in a pointer to the reference variable
itself, not to the class instance. When passing a reference to
a C API, casting it directly to the C type is correct.
Ah I see.
In that case I have some code I need to investigate as it's
probably only working by accident!