' fpClassify':含糊不清的呼叫对超载功能
我成功地在MacBook上以及带有Intel编译器的服务器上编译了代码库。当我通过公司的连续集成测试(具有其自身的构建系统)运行它时,我会在编译中遇到以下错误。
..\corecrt_math.h(415): error C2668: 'fpclassify': ambiguous call to overloaded function
..\corecrt_math.h(300): note: could be 'int fpclassify(long double) noexcept'
..\corecrt_math.h(295): note: or 'int fpclassify(double) noexcept'
..\corecrt_math.h(290): note: or 'int fpclassify(float) noexcept'
..\corecrt_math.h(415): note: while trying to match the argument list '(_Ty)'
with
[
_Ty=kc20::wrapped_int8::underlying
]
/path/to/file/kernel.cpp(69): note: see reference to function template instantiation 'bool isnan<integer_type>(_Ty) noexcept' being compiled
with
[
integer_type=kc20::wrapped_int8::underlying,
_Ty=kc20::wrapped_int8::underlying
]
请注意, kc20
是一个名称空间,包含 wrapped_int8
struct。 wrapped_int8
定义为
struct alignas(1) wrapped_int8 {
using underlying = int8_t;
int8_t value;
// some other function definitions
};
kc20 :: wrapped_int8 :: ustlying
只是 int8_t
。在错误消息中,它似乎仅列出 fpClassify
in =“ nofollow noreferrer”> https://en.cppreference.com/w/cpp/numeric/math/math/fpclassify 。我的代码应该使用此链接的情况(4),因为它是一个积分类型。这里的歧义是什么?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论