Boost logo

Boost :

Subject: [boost] safe integer library -- the scope
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2015-12-11 10:07:14


Hi Robert,

It is great to see this library getting into Boost. It fills an important
gap, but it is only after a long while that I realized that, because the
introductory part of the documentation does not stress it enough, and in
fact it misled me a bit.

My understanding is that safe<int> represents a high level abstraction of
an integral number from mathematics: unlike raw type int, which represents
a set of allowed operations on the underlying processor.

You could say that raw type 'int' is only needed to efficiently implement
higher level abstractions, like BigInt or safe<int> -- the two only differ
in trade-offs between efficiency and the range of values they can represent.

I was missing this in the introduction. Instead I got a somewhat negative
impression that the goal of the library is to turn any UB into throwing
exceptions
(and thereby prevent any UB-based static analysis from detecting programmer
errors).

I would like to see the library in Boost, although I must admit the other
parts do not sound that compelling as safe<int>.

Regards,
&rzej


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk