On Friday, 24 January 2014 at 08:52:24 UTC, Jacob Carlborg wrote:
Why don't you just cast the delegate context pointer to Object? Like this:auto result = cast(Object) dg.ptr; If "result" is not null the context pointer points to an object.
No, this is just a plain (i.e. no-op) cast.
Although this won't handled interfaces. I consider it a bug that an interface cannot be casted to Object.
Not all interface implementations are (Object) classes, cf. IUnknown.
David
