Here is a part of my Class:
//... bool dump_dvars() { fstream& refvar{ output_file }; for_each(_array_start, _array_
You should capture 'this' in the lambda.
The following code compiles and works just fine with g++, clang, VS2010 and VS2013.
#include class A { public: A() : x(5){} void f() const { ([this]() { std::cout << x << std::endl; })(); } private: int x; }; int main() { A a; a.f(); }