26 Jan
2015
26 Jan
'15
9:42 p.m.
Beman Dawes wrote:
Perhaps an error checking policy could be added as a template parameter, with two supplied - one a nop, the other throwing an exception on overflow.
Given that in many, if not most, cases, the check is a no-op - when the value type and the bits match - it might instead make sense to make the methods conditionally noexcept when the bits are enough to store everything in range, and always throw on overflow otherwise.