This is not valid C (because the names Foo and Bar not type specific, you will need to use the struct keyword or use typedef).
In C ++, this is an amazing but valid declaration. It declares b as a function returning Foo, and takes an argument to a type function (pointer to), returning an int, taking the argument of a type pointer to Bar.
To create a declaration of a readable type, I wrote the following code:
#include <typeinfo> #include <iostream> int main() { struct Foo {}; struct Bar {}; Foo(b)(int (Bar*c)); std::cout << typeid(b).name(); return 0; }
Then I compiled it and filtered its output through c++filt . The result is:
main::Foo (int (*)(main::Bar*))
which is completely clear.
The paramagnetic croissant
source share