Closed saxbophone closed 2 years ago
Might want to use concepts to specify the numeric operations need to be supported by a given generic type T such that its substitution into the template is valid. We could create this as a custom constraint ourself, only requiring the minimum number of operations on the type T needed to populate the Uint's digits from it.
The usefulness of this is questionable, I should verify that Uint
can't be strictly initialised from unsigned types smaller than uintmax_t
before doing serious work on this, ideally with an additional set of test cases...
For "constructing" Uint objects from any reasonable numeric type:
to be used somewhat like:
Definitely don't want this as a constructor, not even an
explicit
constructor, we want it as a constructor-like static method to prevent any issues with implicit conversions or promotions.