Re:Bounded Integer: Header-only C++ library replaces integer...
by proverbialbunny on Sunday September 29, 2019 @10:56PM
(#21111404)
Both 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.
[ Parent
| on HN ]
Re:Bounded Integer: Header-only C++ library replaces integer...
by davidstone on Friday October 04, 2019 @08:10PM
(#21162967)
The 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.