Closed Chaosvex closed 4 years ago
With this fix, the above would compile (on a little-endian platform), because it doesn't actually reverse anything, but big_to_native_inplace
will still fail, in endian_reverse
.
A case can be made that both should work. But it's a bit subtle because endian_reverse
on a normal unscoped enum is often undefined behavior because the reversed value is outside of the valid range of the enum. Interestingly, this is not the case for scoped enums; their valid range is the entire range of the underlying type.
For endian_reverse_inplace
though, the library can, in principle, support even unscoped enums; as long as nobody actually tries to read the reversed enum, there's no UB.
The given example should now compile with the current develop.
Boost 1.71.0 introduced a regression that breaks the ability to reverse enum types.
For example:
Under 1.70, this compiles but under 1.71: