visual c++ - Problems with nested lambdas in VC++ -
Does anybody know that this code is VC ++ 2010
class C {public : Zero m (string t) {} zero m (function & lt; string ()> fank) {}}; Void TestMethod (function & lt; void ()> func) {} void TestMethod2 () {TestMethod ([] () {} () (CM ([] () -> string {// compiler error C2668 ( 'Function': unclear call on overloaded function) return ("txt");});}); } Update: Example of complete code:
#include & lt; Functional & gt; #include & lt; Memory & gt; using namespace std; Square c {public: empty m (string t) {} zero m (function & lt; string ()> fank) {}}; Zero TestMethod (function & lt; void ()> func) {} int _tmain (int argc, _TCHAR * argv []) {TestMethod ([] () {cc; cm ([] () -) - & Gt; String {// Compiler Error C2668 ('function': ambiguous call to overloaded function M) returns ("txt");});}); Return 0; }
This is a bug of VC ++ compiler.
Comments
Post a Comment