So i'm trying to serialize information into a string using std::stringstream
but the compiler doesn't like me.
enum PacketType : unsigned int {
PacketType_unknown = 0,
PacketType_ping,
PacketType_server_welcome,
PacketType_client_greetings,
};
std::stringstream ss;
unsigned int v;
PacketType p;
ss << (unsigned int)somevalue;
// error here
ss >> p;
The error is:
no match for 'operator>>' (operand types are 'std::stringstream' {aka
'std::__cxx11::basic_stringstream<char>'} and 'PacketType')GCC
EDIT: Forgot too add so many stuff because I thought it wasn't important