Thursday, June 16, 2011

Anonymous classes in C++


int main() {
[] {
struct A {
void func() {
std::cout << "hello" << std::endl;
}
};
return A();
}().func();
}


The most amazing feature of new C++0x, I believe.

No comments:

Post a Comment