mirror of
https://github.com/Rogiel/PacketBuffer
synced 2025-12-06 00:13:04 +00:00
Removes an unecessary byte-order swapping for bool types that caused problems when compiling with Boost 1.71
This commit is contained in:
@@ -291,7 +291,6 @@ namespace PacketBuffer {
|
|||||||
*/
|
*/
|
||||||
inline Packer& pack(bool b) {
|
inline Packer& pack(bool b) {
|
||||||
static_assert(sizeof(b) == 1, "bool size must be 1 byte");
|
static_assert(sizeof(b) == 1, "bool size must be 1 byte");
|
||||||
boost::endian::conditional_reverse_inplace<boost::endian::order::native, Endianess>(b);
|
|
||||||
return pack(reinterpret_cast<const char*>(&b), sizeof(b));
|
return pack(reinterpret_cast<const char*>(&b), sizeof(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -290,7 +290,6 @@ namespace PacketBuffer {
|
|||||||
Unpacker& unpack(bool& b) {
|
Unpacker& unpack(bool& b) {
|
||||||
static_assert(sizeof(b) == 1, "bool size must be 1 byte");
|
static_assert(sizeof(b) == 1, "bool size must be 1 byte");
|
||||||
unpack(reinterpret_cast<char*>(&b), sizeof(b));
|
unpack(reinterpret_cast<char*>(&b), sizeof(b));
|
||||||
boost::endian::conditional_reverse_inplace<Endianess, boost::endian::order::native>(b);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user