U
utab
Dear all,
I had some replies on my previous post.But wanted to learn sth. Static
member functions of a class can access only the static data members of
the same class. So this principle in mind, lets advance one step
further,
lets say in a class I have a map in the private declerations of the
class
private:
static map<string, vector<string> > m_;
and in the public part
public:
static void Initialize_();
And in the implementation file of the class, inside the Initialize_()
function I am trying to initialize the static map like
m_["g"].push_back("x");
m_["g"].push_back("x");
m_["g"].push_back("z");
This looks logically true to me but compilation does not agree with
that. It results in an undefined reference error.
And for nearly one day, I have not been able to figure out the problem.
Regards,
I had some replies on my previous post.But wanted to learn sth. Static
member functions of a class can access only the static data members of
the same class. So this principle in mind, lets advance one step
further,
lets say in a class I have a map in the private declerations of the
class
private:
static map<string, vector<string> > m_;
and in the public part
public:
static void Initialize_();
And in the implementation file of the class, inside the Initialize_()
function I am trying to initialize the static map like
m_["g"].push_back("x");
m_["g"].push_back("x");
m_["g"].push_back("z");
This looks logically true to me but compilation does not agree with
that. It results in an undefined reference error.
And for nearly one day, I have not been able to figure out the problem.
Regards,