I've created a Swift Package called "DelTal", which allows you to create number types with bound, context which automagically conforms to UnsignedInteger
.
Any feedback is most welcome!
I've created a Swift Package called "DelTal", which allows you to create number types with bound, context which automagically conforms to UnsignedInteger
.
Any feedback is most welcome!
This is very cool!
But: in general a bound type cannot conform to UnsignedInteger
; part of the semantics of a type conforming to UnsignedInteger
are that it includes zero. Protocols are not just syntactic requirements.
This should in no way be interpreted as discouragement from pursuing this, rather that you want to define a new protocol to use here. UnsignedInteger
is not it.