\x.xx in C++... What's the type of "x"? - x is a function; let's assume a generic domain "D" and a generic codomain "C" x: D -> C x in D x C C++: std:function<C(D)> - "xx" means "x applied to x", so "x" must be of type "D" x in D C++: D So, D = D x C (C++: D and std::function<C(D)> are the same type), which makes no sense!!! Again, in C++: x has type std::function<C(D)> x(x) means that x has type D!!! Solution: wrap the function into a structure "struct F" (or "class F")... So, the function has an argument of type "struct F" and returns a value of type std::function<int(int)> struct F { std::function<std::function<int(int)>(F)> apply; } Now, it is legal to do struct F x = ... x.apply(x);