|
Boost : |
Subject: Re: [boost] [review queue] What to do about the library review queue?
From: Peter Dimov (lists_at_[hidden])
Date: 2017-03-15 21:40:08
degski wrote:
> Because I think the idea is flawed from the start.
>
> int x = 2 * 2;
>
> is wrong in principle, correct would be:
>
> int64_t x = 2 * 2;
That's what the library does (in 'automatic' promotion mode, which should be
only mode in my opinion.) When you multiply two integers, one having range
[0, M] and the other having range [0,N], you get an integer with range [0,
M*N]. So safe<uint32_t> * safe<uint32_t> gives safe<uint64_t> (almost).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk