SFML community forums

Help => Network => Topic started by: Soul on March 02, 2013, 12:20:34 pm

Title: [SOLVED]operator>>
Post by: Soul on March 02, 2013, 12:20:34 pm
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?
Title: Re: operator>>
Post by: Nexus on March 02, 2013, 01:48:52 pm
what's wrong?
That's what you should tell us. What is the error message? Can you reproduce a minimal and complete example so that we're sure the problem lies not elsewhere in your code?
Title: Re: [SOLVED]operator>>
Post by: Soul on March 02, 2013, 02:12:54 pm
problem solved ; p
Title: Re: [SOLVED]operator>>
Post by: Nexus on March 02, 2013, 02:57:04 pm
This is your 4th thread in the Network section within a few days. Please invest at least a few minutes trying to solve your problems. This includes reading error messages carefully, searching on the internet (and especially this forum) for existing solutions, and using the debugger.

If your problem persists after a long time, you can still ask a question here. But if you do so, describe your problem in a meaningful way and show at least some initiative. See also Read before posting (http://en.sfml-dev.org/forums/index.php?topic=5559.0).