![](/img/trans.png)
[英]GCC couldn't vectorize 64-bit multiplication. Can 64-bit x 64-bit -> 128-bit widening multiplication be vectorized on AVX2?
[英]Can't Overload << Operator on 64-bit Linux
我正在使用Qt开发,strongHercul结构具有定义为uint64_t min
和uint64_t max
(我只是不想为此使用quint64)。 在尝试重载<<运算符时,如下所示。
QDataStream &operator<<(QDataStream &ds, const strongHercul& hercul)
{
ds << hercul.min << hercul.max;
return ds;
}
QDataStream &operator>>(QDataStream &ds, strongHercul& hercul)
{
ds >> hercul.min >> hercul.max;
return ds;
}
我收到以下错误:
error: ambiguous overload for 'operator<<'
(operand types are 'QDataStream' and 'const uint64_t {aka const long unsigned int}')
data_stream << hercul.min << hercul.max;
^
error: no match for 'operator>>'
(operand types are 'QDataStream' and 'uint64_t {aka long unsigned int}')
data_stream >> hercul.min >> hercul.max;
^
真的不明白怎么了吗? 我认为这可能会导致我正在运行的64位系统导致此代码在32位Windows上正常运行? 问题是在使用uint64_t
如何重载?
从外观QDataStream
, QDataStream
没有uint64_t
重载。 结果,输出运算符试图转换为多个选择之一,即存在歧义,并且对于输入运算符,需要非const
引用,并且没有匹配的运算符。 您可能应该按照quint64
旅行,这似乎是一个unsigned long long int
而uint64_t
似乎是一个unsigned long int
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.