hey, idk why but i can't compile operator >> from packet
client.cpp
sf::Packet& operator >>(sf::Packet& packet, Client &c)
{
packet >> c.family >> c.action;
}
client.h
class Client
{
public:
sf::TcpSocket Socket;
sf::Packet Send;
sf::Packet Recv;
Packet::PacketFamily family;
Packet::PacketAction action;
int ClientID;
};
sf::Packet& operator <<(sf::Packet& packet, Client &c);
sf::Packet& operator >>(sf::Packet& packet, Client &c);
packet.h
namespace Packet
{
enum PacketFamily : unsigned char
{
PACKET_A_INIT = 0,
PACKET_B_INIT = 1
};
enum PacketAction : unsigned char
{
PACKET_REQUEST = 1,
PACKET_ACCEPT = 2,
PACKET_REPLY = 3
};
std::string GetFamilyName(PacketFamily family);
std::string GetActionName(PacketAction action);
}
what's wrong?