I have this class (declared in the header file):
class HttpError
{
static std::map<unsigned long, const char *> statusCodes;
std::string msg;
public:
HttpError();
};
And I have put this in the corresponding *.cpp file:
HttpError::statusCodes = {
{100L, "Continue" },
{101L, "Switching Protocols" }}
When I compile, I got the error "statusCodes is private within this context". Yes, I know that it is private, but how it is supposed to initialize an static private member??
I've read the answers here and here, and I humbly think I have the same, but surpringsingly does not work. What am I doing wrong?