4 ms·
At first glance it seems to be similar to boost::safe_numerics. Are there significant differences? https://github.com/boostorg/safe_numerics https://github.com
by duneroadrunner 7y ago
At first glance it seems to be similar to boost::safe_numerics. Are there significant differences?
https://github.com/boostorg/safe_numerics https://github.com/boostorg/safe_numerics
- proverbialbunny 7y agoBoth libraries do the same thing. Boost lets you set your exception policy and I'm unsure if this Bounded Integer library gives the same level of control.
- davidstone 7y agoThe bounded::integer types accept three template parameters: `integer<min, max, overflow_policy>`. That final parameter can be bounded::throw_policy, which is itself templated on the exception type thrown. The default exception policy is "overflow is undefined behavior". The other two policies supported out of the box are wrapping / modulo and saturation / clamping.