为什么 VC2015RC 下 `is_constructible, int(*)(int,int)>::value` 为 true

2023-12-07

#include <functional>
using namespace std;

int main()
{
   static_assert(is_constructible<function<int(int)>, int(*)(int,int)>::value, "error");
}

该代码未使用 GCC 和 Clang 编译,但使用 Visual C++ 2015 RC 通过。

这是符合标准的行为还是只是一个错误?


std::function的构造函数曾经接受阳光下的一切(它是一个template<class F> function(F f)).

然后它受到标准的限制(通过LWG 问题 2132),但实现该约束需要表达式 SFINAE,其中微软的编译器还不支持.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为什么 VC2015RC 下 `is_constructible, int(*)(int,int)>::value` 为 true 的相关文章

随机推荐