Closed philipp2100 closed 4 years ago
I think you could allow these operations, especially since long = long + int is already allowed.
That was indeed a bug that it didn't work, fixed now.
Another step would be to allow long = int + unsigned, for example, if long is guaranteed to hold the result. But I understand that this would change the current concept of the library, so probably this should have to be explicitly enabled.
I really don't want to allow too many conversions.
Btw., I don't understand why checked arithmetics are not the default.
This library is mostly about type safety, so a ts::integer
should be a type-safe version of int
. The checked arithmetic was just a nice convenience feature you can get anyway but it is not the default.
I think you could allow these operations, especially since
long = long + int
is already allowed.Another step would be to allow
long = int + unsigned
, for example, iflong
is guaranteed to hold the result. But I understand that this would change the current concept of the library, so probably this should have to be explicitly enabled. Btw., I don't understand why checked arithmetics are not the default. Maybe, this and the letter could be considered together, as part of an approach to have the safest possibility as the default and allow more operations or less checks if explicitly desired.Anyway, good job! Thanks!