我对MSVC2010中的lambda有一个问题。
编译成功:
auto f1 = []() { };
boost::function<void()> a = f1;但是它带来了一个错误C2440:
auto f2 = []()
{
auto f3 = []() { };
boost::function<void()> b = f3;
};错误C2440:
'initializing' : cannot convert from 'int' to 'boost::function<Signature>'
with
[
Signature=void (void)
]
No constructor could take the source type, or constructor overload resolution was ambiguous为什么?它能在GCC4.6中工作吗?
发布于 2012-04-20 19:17:42
可能是MSVC中的错误(错误消息似乎非常可疑)。它在GCC 4.7中工作。
https://stackoverflow.com/questions/10244979
复制相似问题