You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases we need type-level numeric parameters which can be both signed and unsigned.
As I see currently corresponding trait is missing in typenum. This would like to be pretty helpful.
I see two ways to implement it:
Rename Integer trait to Signed.
Add new Integer trait which implemented for both Unsigned and Signed. Pros: Clear meaningful trait names. Cons: Breaking API changes.
Add new Number trait which implemented for both Unsigned and Signed. Pros: Non-breaking API changes. Cons: Less meaninful trait name.
Can anybody suggest more clear trait name for second solution?
The text was updated successfully, but these errors were encountered:
The name Integral is used in some contexts as a more general name for "anything integer-like".
As an example, in Haskell, Natural is used for arbitrary-precision unsigned, Integer for arbitrary-precision signed, Word for 32/64-bit unsigned, Int for 32/64-bit signed, and Integral for the trait that they all have in common.
In some cases we need type-level numeric parameters which can be both signed and unsigned.
As I see currently corresponding trait is missing in typenum. This would like to be pretty helpful.
I see two ways to implement it:
Integer
trait toSigned
.Add new
Integer
trait which implemented for bothUnsigned
andSigned
. Pros: Clear meaningful trait names. Cons: Breaking API changes.Number
trait which implemented for bothUnsigned
andSigned
. Pros: Non-breaking API changes. Cons: Less meaninful trait name.Can anybody suggest more clear trait name for second solution?
The text was updated successfully, but these errors were encountered: