3 ms·
The syntax for this is quite nice. call_me(^int (int x, int y) { return x + y; }); I like it quite a bit better than the proposed c++ lambda syntax. [
by onedognight 17y ago
The syntax for this is quite nice.
call_me(^int (int x, int y) { return x + y; });
I like it quite a bit better than the proposed c++ lambda syntax.
[](int x, int y) -> int { return x + y; }
The ^ is very ananogous to *. You could declare the above function call_me() with something like this
void call_me(int (^fun)(int x, int y))
{
fun(fun(4,5), fun(3,6));
}
which is quite "C like".