Method pointers are *function* pointers?? Or delegates??

Alex Rønne Petersen alex at lycus.org
Fri May 18 11:26:44 PDT 2012


On 18-05-2012 20:22, Mehrdad wrote:
> My brain just exploded.
> Can someone explain what's going on?
>
> class Test
> {
> public void foo() { }
> }
>
> static assert(is(typeof(&Test.foo) == void function()));

Delegates. Pointer to member function + class instance.

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list