我在GitHub上找到了这段代码,但不是很明白:
#define lambda(ret_type, _body) ({ ret_type _ _body _; })
Run Code Online (Sandbox Code Playgroud)
然后:
int (*max)(int, int) = lambda(int,
(int x, int y) {
return x > y ? x : y;
});
int max_value = max(1, 2);
// max_value is 2
Run Code Online (Sandbox Code Playgroud)
里面的下划线是做什么的#define
,它是如何返回函数指针的?