diff --git a/chat_messages.hpp b/chat_messages.hpp index 12f98d3..c11f8ba 100644 --- a/chat_messages.hpp +++ b/chat_messages.hpp @@ -14,6 +14,7 @@ namespace chat PING = 6, PONG = 7, BYE = 8, LOGIN = 9, LOGOUT = 10, TERM = 0x7f }; + char byte(message msg) { return static_cast(msg); } class chat_message @@ -31,10 +32,9 @@ namespace chat {} std::string get() const - { return static_cast(_header) + _content + static_cast(message::TERM); } + { return byte(_header) + _content + byte(message::TERM); } }; - std::ostream& operator<<(std::ostream& os, const chat_message& msg) { return os << msg.get(); } } \ No newline at end of file