42 #include <boost/predef/other/endian.h>
63 #if BOOST_ENDIAN_BIG_BYTE
65 #elif BOOST_ENDIAN_LITTLE_BYTE
68 #error "unable to determine system endianness"
73 template <std::
size_t N>
82 std::swap (bytes[0], bytes[1]);
88 std::swap (bytes[0], bytes[3]);
89 std::swap (bytes[1], bytes[2]);
95 std::swap (bytes[0], bytes[7]);
96 std::swap (bytes[1], bytes[6]);
97 std::swap (bytes[2], bytes[5]);
98 std::swap (bytes[3], bytes[4]);
101 template <
typename T>
104 swap_byte_order<sizeof (T)> (
reinterpret_cast<char*
> (&value));
void swap_byte_order(char *bytes)
void swap_byte_order< 1 >(char *)
@ little_endian_byte_order
void swap_byte_order< 4 >(char *bytes)
void swap_byte_order< 2 >(char *bytes)
void swap_byte_order< 8 >(char *bytes)