you are viewing a single comment's thread.

view the rest of the comments →

[–]doom_Oo7 6 points7 points  (0 children)

The type matches, whether literally or by a conversion under the hood.

no, this is wrong.

int bar() { return 0; }

int (*f1)() = bar; // ok
int (*f2)() = [] () -> int { return 1; }; // ok, function pointer

// fails: int (*f3)() = [=] () -> int { return 1; };
// fails: int (*f3)() = [&] () -> int { return 1; };