class C { public: void M(string t) {} void M(function<string()> func) {} }; void TestMethod(function<void()> func) {} int _tmain(int argc, _TCHAR* argv[]) { TestMethod([] () { C c; c.M([] () -> string { //compiler error C2668 ('function':ambiguous call to overloaded function M) return ("txt"); }); }); C c2; c.M([] () -> string { // no compiler error return ("txt"); }); return 0; } I don't know why the first call to function M can't be compiled. I think this is a bug of the compiler
Visual Studio/Team Foundation Server/.NET Framework Tooling version
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results