U
utab
Dear all,
in a class definition
class X{
private:
static map< string , map<string, int> > word_map;
static void initialize();
};
and in the implementation file, I may fill out the map inside the
function block not outside any function block. I asked this question
before and got a reply advicing to put those lines in an initializer
function. This works fine but I wondered why I could not define and
initiliaze outside the function block. As
word_map["try"].insert(make_pair("try",1));
and the entries outside any of the functions. This is sth related to
static but could not figure that out.
thanks
in a class definition
class X{
private:
static map< string , map<string, int> > word_map;
static void initialize();
};
and in the implementation file, I may fill out the map inside the
function block not outside any function block. I asked this question
before and got a reply advicing to put those lines in an initializer
function. This works fine but I wondered why I could not define and
initiliaze outside the function block. As
word_map["try"].insert(make_pair("try",1));
and the entries outside any of the functions. This is sth related to
static but could not figure that out.
thanks