Core/PacketIO: Disable implicit bool to int conversions for ByteBuffer operators

This commit is contained in:
Shauren
2025-05-21 21:17:38 +02:00
parent 923aa1f52a
commit 7ca9e9005d

View File

@@ -286,6 +286,8 @@ class TC_SHARED_API ByteBuffer
*/
void PutBits(std::size_t pos, std::size_t value, uint32 bitCount);
ByteBuffer& operator<<(bool) = delete; // prevent implicit conversions to int32
ByteBuffer& operator<<(char value)
{
append<char>(value);
@@ -372,6 +374,8 @@ class TC_SHARED_API ByteBuffer
return operator<<(std::string_view(str ? str : ""));
}
ByteBuffer& operator>>(bool&) = delete;
ByteBuffer& operator>>(char& value)
{
read(&value, 1);