Tried this in GCC 4.6 and it compiles and links, but gives a "bus error" message on runtime on MacOS. VS2010 doesn't even compile it.

But the question is, should this actually work in standard C++0x?

#include <cstdio>
int (*main)()=[]()->int{printf("HEY!\n");return 0;};

Yes, what it's trying to do is to define "main" as a lambda function.

Edit
Report