12 Mar
2017
12 Mar
'17
2:37 p.m.
John Maddock wrote:
So I believe the correct behaviour should be:
* Bitwise operations on signed types should be allowed by default as long as they don't invoke undefined behaviour by operating on (or generating) negative values - this should be a runtime check.
Agreed. The amusing consequence (I'm easily amused) is that one will be able to check that a safe<int> x is nonnegative with x | 0, a well known Javascript idiom.