Skip to content

Function Pointer Types

CD2 edited this page Feb 8, 2023 · 2 revisions

Global Function Pointer

You can define a global function pointer with the func keyword.

void f(){}

func $void() fp = f;

Member Function Pointer

You can define member function pointers with the method keyword. What member function it is depends on where it is defined.

&C

{

void f(){}

method $void() fp = f;

}

Anonymous Function

You can define an anonymous function pointer with ~.

void f()

{

~$void() fp = [void(){}];

}

Clone this wiki locally