If you're looking for prior art, Ada has the Bit_Order and Scalar_Storage_Order attributes[0]; the latter is a GNAT extension.
[0] https://www.adacore.com/gems/gem-140-bridging-the-endianness...
[0] https://www.adacore.com/gems/gem-140-bridging-the-endianness...
No comments yet.