
([](){})() is now legal C++. - rgarcia
http://twitter.com/#!/mattmight/status/103592582675832833 
======
reemrevnivek
Full text of the tweet:

> Oh great. ([](){})() is now legal C++.

That's interesting, but what does it mean? I don't know enough about C++ to
parse that expression.

More importantly, what coding styles or features do the syntax rules enable by
allowing us to use that string of symbols? I don't use Twitter, but I think
that Matthew missed an opportunity to write an interesting and useful article
or blog post by expressing this through Twitter. He already has a number of
other articles here: <http://matt.might.net/articles/>

~~~
nimbix
I'm also not a c++ programmer, but from what I've read so far I'd say the
[](){} part is a lambda function which:

    
    
      [] - captures no vars
      () - accepts no parameters
      {} - has an empty body
    

Wrapping it in (...)() immediately executes it.

