C++ C++;使用lambda时没有匹配的函数调用进行转换

C++ C++;使用lambda时没有匹配的函数调用进行转换,c++,lambda,C++,Lambda,好吧,这件事让我很难堪。可以与Visual Studio一起使用,但不能使用代码::块(GNU编译器) m_团队是一个地图:typedef-map-stVecMap teamNames是一个集合:typedef set StrSet stVecPair是一对匹配的m_团队:typedef对stVecPair 完全错误 error: no matching function for call to 'transform(std::map<std::basic_string<char&g

好吧,这件事让我很难堪。可以与Visual Studio一起使用,但不能使用代码::块(GNU编译器)

m_团队
是一个地图:
typedef-map-stVecMap

teamNames
是一个集合:
typedef set StrSet

stVecPair
是一对匹配的
m_团队
typedef对stVecPair

完全错误

error: no matching function for call to 'transform(std::map<std::basic_string<char>, 
std::vector<Person*> >::const_iterator, std::map<std::basic_string<char>, 
std::vector<Person*> >::const_iterator, std::insert_iterator<std::set<std::basic_string<char> > >, 
RaceAnalyzer::teams() const::<lambda(RaceAnalyzer::stVecPair&)>)
错误:调用“transform(std::map::const_迭代器、std::map::const_迭代器、std::insert_迭代器、,
RaceAnalyzer::teams()常量::)

正如我所评论的,您忘记了
-std=c++11
选项>您可以发布完整的错误消息吗?发布错误消息。发布a。您不需要在此lambda上使用显式返回类型。@chris您可能需要它,具体取决于您使用的VS版本。@David…也适用于cygwin/g++4.8.3。您是否给了编译器
-std=c++11
?@David我还建议您养成习惯,在创建新项目时始终启用此选项。(正如我所做的…)C++11已经足够好用了,如果你忘了打开,该死的错误信息就会出现在这里。
error: no matching function for call to 'transform(std::map<std::basic_string<char>, 
std::vector<Person*> >::const_iterator, std::map<std::basic_string<char>, 
std::vector<Person*> >::const_iterator, std::insert_iterator<std::set<std::basic_string<char> > >, 
RaceAnalyzer::teams() const::<lambda(RaceAnalyzer::stVecPair&)>)