
14 Dec
2015
14 Dec
'15
6:14 p.m.
On 12/14/15 9:45 AM, Andrzej Krzemienski wrote:
2015-12-14 18:34 GMT+01:00 Robert Ramey
: On 12/14/15 9:21 AM, Andrzej Krzemienski wrote:
2015-12-14 17:39 GMT+01:00 Robert Ramey
: Ok, I see. So, there is something more to it than just the set of values.
safe<T> does not check upon conversion from T.
I believe it does. If it doesn't it's a mistake.
It would make sense to skip the check:
int i = whatever(); safe<int> si (i); // this just cannot go wrong.
It does that. I guess I misunderstood the comment. Basically given a binary operation R <- T op U where either T or U are safe types, the operation is checked at runtime if and only if a) either T or U is a safe type b) the result cannot be guaranteed to fit into a type R Robert Ramey