Is there support for lambda expressions from C++ 0x in Visual Studio 2008 SP1? Example below throws me syntax errors. Is there any ‘-Cpp0x’ flag for compiler or something?
#include <algorithm> #include <iostream> #include <ostream> #include <vector> using namespace std; int main() { vector<int> v; for (int i = 0; i < 10; ++i) { v.push_back(i); } for_each(v.begin(), v.end(), [](int n) { cout << n << ' '; }); cout << endl; }
Thank you in advance.
See Stackoverflow question #146381
Simply put: no. Visual Studio 2010 will support C++0x to some extent, but I’m unsure if that will include lambda expressions.