But we can make this portable without compromising the behaviour on the vast majority of systems where CHAR_BIT=8 by using CHAR_BIT in place of 8 and PRIVATE::exp(2, CHAR_BIT) in place of 256
This should support any systems where CHAR_BIT > 8. The rest of the code should be checked over for any other places where byte = 8-bit is assumed.
Current code assumes 8-bit (a reasonable assumption):
https://github.com/saxbophone/arby/blob/8f9b0bd40e82fd6a558eb71cb53091b628dbaee9/arby/include/arby/Nat.hpp#L827-L840
But we can make this portable without compromising the behaviour on the vast majority of systems where CHAR_BIT=8 by using
CHAR_BIT
in place of 8 andPRIVATE::exp(2, CHAR_BIT)
in place of 256This should support any systems where
CHAR_BIT > 8
. The rest of the code should be checked over for any other places where byte = 8-bit is assumed.