C++0x λ + 提升::函数故障
C++0x lambda + boost::function trouble
我在MSVC2010中遇到了lambdas的问题。
它已成功编译:
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中有效吗?
可能是 MSVC 中的一个错误(错误消息似乎非常可疑)。它适用于 GCC 4.7。
相关文章:
- C++函数过载会导致 SEG 故障
- 分段故障 11,从类函数显示动态 C 字符串
- 如何传播 NodeJS 包装C++代码的函数故障?
- std :: unordered_map分段构造函数中的故障
- C++中的累积函数故障无法找到平均值
- 分割故障(核心倾倒) - 材料函数
- 在调用函数中指定指针时进行分割故障
- OPENCV 3.3-使用GPU函数时分割故障
- 为什么最后一个拆分函数会导致分割故障?如何解决此问题
- 带指针的调用函数会导致段故障
- 递归函数上的分割故障C
- C 单链接列表复制构造函数分割故障
- 从新位置调用函数时C 细分故障
- 崩溃:分段故障:增强序列化加载 - 用null调用构造函数
- C 查找无SQRT函数循环故障的平方根
- std::map 的比较器函数中的 SEG 故障/未定义行为
- 函数仅在按Enter或到达文件末尾时才会导致分割故障
- 未解析的外部符号突然出现.构造函数故障
- C++0x λ + 提升::函数故障
- 可变模板最大函数故障