The following example demonstrates the problem that I encountered in VC ++ 2010:
class Foo { template<class T> static T foo(T t) { return t; } public: void test() { auto lambda = []() { return foo(1); };
VC ++ produces: error C3861: 'foo' : identifier not found
If I answer the call to foo: Foo::foo(1); , then this example compiles with a warning: warning C4573: using 'Foo::foo' requires the compiler to capture 'this' , but the current capture mode does not allow it by default
What does the standard say about this case? Should an unqualified name be found? Is a qualified name required to capture this ?
source share