7 Mar
2017
7 Mar
'17
9:03 p.m.
On 3/7/17 11:33 AM, Andrzej Krzemienski via Boost wrote:
safe<int> does a check for this condition, but I find it quite surprising that it throws a domain_error rather than overflow_error. How do you make a call whether it is an overflow or a domain error? For mathematical ints dividing -2147483648 by -1 is well defined.
Truth is I didn't take a whole lot of care in deciding which one to use. In this case, I think your right that overflow would be a better choice.