Stephan Bergmann wrote:
Kay Ramme - Sun Germany - Hamburg wrote:
Hi,

please correct me, if I am wrong. I understand this as a 'C' inherited C++ oddity (no constructors for integral values), which leads to a warning if the first operation on the integral value is not classified as "assignment". Obviously 'operator >>=' has not been classified as "assignment" at least not for the right operand.

No, the compiler does not assume the user-supplied operator >>= has any assignment semantics. Rather, as the operator >>= is inline, GCC tries
I thought that this is what I said ;-), however.

So, it seems that we have used the wrong operator here. Therefor I tend to agree to Frank, that we may want to fix this.

The choice of operator is indeed unfortunate.  However, I do not agree that

  - T b;
  + T b = T();

is in general a fix that improves code quality.
Certainly not in general, only for the places the warning gets emitted. And only for the reason, that we may have chosen the wrong operator.

If I get it right, the compiler makers are more or less in a dilemma.

-Stephan
Kay

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to