42 #include <boost/predef/other/endian.h>
62 #if BOOST_ENDIAN_BIG_BYTE
64 #elif BOOST_ENDIAN_LITTLE_BYTE
67 #error "unable to determine system endianness"
72 template <std::
size_t N>
81 std::swap (bytes[0], bytes[1]);
87 std::swap (bytes[0], bytes[3]);
88 std::swap (bytes[1], bytes[2]);
94 std::swap (bytes[0], bytes[7]);
95 std::swap (bytes[1], bytes[6]);
96 std::swap (bytes[2], bytes[5]);
97 std::swap (bytes[3], bytes[4]);
100 template <
typename T>
103 swap_byte_order<sizeof (T)> (
reinterpret_cast<char*
> (&value));