Would it be possible to add C++'s implementation to C, or does it rely on other C++ features that C doesn't already support?
#define max(a,b) \
({ typeof (a) _a = (a); \
typeof (b) _b = (b); \
_a > _b ? _a : _b; })
https://gcc.gnu.org/onlinedocs/gcc/Typeof.htmlTo be fair, typeof is not as useful without statement expressions (`({ ... })`), and statement expressions aren't as widely supported.
[1] All the major compilers support it (clang, GCC, IBM, Intel, Microsoft, Solaris, etc), plus or minus underscores in the identifier.
Every closure is an anonymous class in C++.