Hey Adam,
an interesting aspect of what I'd like to achieve is to use
compile-time reflection to generate the wrapper functions for all
the delegates (there are ~ 10).
The pattern is like what I presented eariler and in addition to
that there are some delegates which have no return type (void).
On Saturday, 5 July 2014 at 22:28:48 UTC, Adam D. Ruppe wrote:
In general, remember any class reference in D is already
equivalent to a pointer in C or C++ and can be casted straight
to void* without needing to take its address.
Thanks Adam,
you're a life saver ;). It works like a charme.
On Saturday, 5 July 2014 at 22:18:56 UTC, Marco Cosentino wrote:
auto client = *(cast(ClientImplementation*) data);
Try just
auto client = cast(ClientImplementation) data;
and
this.setProcessCallback(callback, cast(void *) &this);
setProcessCallback(callback, cast(void*) this);
Hi,
I'm quite new to D and I'm not able to find out what I'm doing
wrong.
Consider the following code:
class ClientImplementation {
private ProcessDelegate processDelegate;
void setProcessDelegate(ProcessDelegate deleg) {
this.processDelegate = deleg;
extern(C) ProcessCallback