I have 8 years of coding experience, but I have never seen that the [] operator is passed as a parameter to a function definition.
For example, the following code (from an open source project):
bree::porder(m_root, [] (treenode* node) { delete node; });
Throughout my coding life, I have always defined [] as an operator reloader, and not as a parameter.
So what does this new syntax mean?
I am using the compiler that comes with Visual Studio 2003. How can I modify the above code to compile in VS 2003?
c ++ lambda visual-c ++ square-bracket visual-studio-2003
Arjun
source share