Boost logo

Boost :

Subject: Re: [boost] Official warnings policy?
From: Patrick Horgan (phorgan1_at_[hidden])
Date: 2009-11-12 18:38:12


Stewart, Robert wrote:
> Shouldn't the test confirm that an int can be assigned to a short in a variant and that the resulting short has the same value as when the same int is assigned to a short not in a variant? That test need not produce a warning because comparing the results from the two assignments proves or disproves the behavior of variant.
>
The point of the warning is that it is not guaranteed that the resulting
short will have the same value. On my machine the maximum value of a
short is 65535, and of an int is 18446744073709551615. That leaves
18446744073709486080 values for which the resulting short will truncate
the int value and only 65536 which wouldn't. If you wanted to be able
to use int like this with variant, you'd have to change the design of
variant. If it's a requirement that this work, then you'd file a bug.

Patrick


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