Re: Distinguishing a pointer to a function and a closure

2019-11-11 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 11 November 2019 at 13:10:44 UTC, berni44 wrote: (a normal delegate seems to be an Object somehow, though). The .ptr method is a pointer to the data associated with the delegate. It might be an object (class or struct) or it might be a memory block (for local variables on the stac

Distinguishing a pointer to a function and a closure

2019-11-11 Thread berni44 via Digitalmars-d-learn
While debugging phobos I came across some stuff I don't understand. A small example: void foo(void* p) { Object o = cast(Object) p; ClassInfo oc = typeid(o); } class Bar { void some_func(int i) {} void do_something(void delegate(int) d) { // is it possible to check