Boost logo

Boost :

Subject: Re: [boost] Current Guidance on Compiler Warnings?
From: Gavin Lambert (boost_at_[hidden])
Date: 2018-11-26 22:15:31


On 27/11/2018 09:40, Emil Dotchevski wrote:
> This is not what unsigned is for. You should generally use signed ints even
> if the value can't be negative.

Why? Other than being less typing (which is, I think, the real
mistake), what reason is there for this?

> Fact: the cast does not do the same thing as the implicit conversion.
>
> (The cast converts to the type you specify in the cast. The implicit
> conversion converts to the target type.)

No, the implicit conversion promotes to *some* type (usually one of int,
unsigned, int64_t, or uint64_t), which is not necessarily the type of
either.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk