提问人:Sam Moldenha 提问时间:10/6/2023 最后编辑:Sam Moldenha 更新时间:10/6/2023 访问量:58
当使用 std::complex <_Float16> 进行乘法时,对“__constexpr_copysign”的调用是模棱两可的 C++
when using std::complex<_Float16> for multiplication call to '__constexpr_copysign' is ambiguous c++
问:
我正在尝试使用,但 .我收到以下错误:std::complex<_Float16>
std::operator<_Float16>*()
call to '__constexpr_copysign' is ambiguous
__a = std::__constexpr_copysign(std::__constexpr_isinf(__a) ? _Tp(1) : _Tp(0), __a);
^~~~~~~~~~~~~~~~~~~~~~~~~
note: in instantiation of function template specialization 'std::operator*<_Float16>' requested here
std::complex<_Float16> c = a * b;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:630:54: note: candidate function
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:634:55: note: candidate function
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:639:1: note: candidate function
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
在上面,我有包含 的迭代器,因此这将是一个小的可重现示例:std::complex<_Float16>
int main(){
std::complex<_Float16> a(10.0, 11.2);
std::complex<_Float16> b(3.0, 4.0);
std::complex<_Float16> c = a * b;
return 0;
}
这导致了上述错误。如何在不修改 cmath 文件的情况下解决此问题?
答: 暂无答案
评论
float16_t
float
double
long double
_Float16
float16_t
_Float16
_Float16
std::complex
std::complex<_Float16>
std::complex<_Float16>
_Float16
double
float