Hello,
I know that the following question is not about SFML, but I also use SFML in this project and I don't want to sign up in another forum - sry. BUT it is only a little question and it would be great if you would help me.
My problem:
I have a class with some member-variables and some member-functions. I also have an enum named "result", it's like "status". It is declared as public. But a private funktion has this enum as return-type, and at this point the compiler "don't know" the enum. Here the code:
class CQueryManager
{
private:
sf::TcpSocket m_Socket;
result m_ConvertSocketStatusToResult(sf::Socket::Status Status);
public:
CQueryManager();
enum result {OK, ERROR, DISCONNECTED, NOTREADY};
result connect(sf::IpAddress IP, unsigned short Port, sf::Time Timeout = sf::Time::Zero); ///connects to the ServerQuery
result sendCommand(std::string Command); ///sends the string to the ServerQuery
std::string receive(); ///returns received string / returns NULL if there is nothing to receive or received nothing
};
So how I tell the compiler that the declaration will come a few lines later ? I tried "enum result;" before class declaration, but it did'nt work. Please help me.
Best regards.
TheBrownShape