U
utab
Dear all, I am confused at some point on the initialization of static
map member of a class. The class I have designed id something like
this.
class Class_name{
public:
private:
.
.
void Test_Field(const string &, const string &)throw();
void Compute_Coordinates(double p)throw(); // p is the
geometrical parameter
static map<string,vector<string> > FIELDS; // Initialization
Outside of Class Declaration
};
// Initialization of Static Map Member
Mesh_Gen:FIELDS["G"].push_back("G"));
Mesh_Gen:FIELDS["G"].push_back("I"));
Mesh_Gen:FIELDS["G"].push_back("C"));
Mesh_Gen:FIELDS["G"].push_back("X"));
I tried something like this one but did not compile.
If you try to initialize a simple static member you can do that with
type Class_name::variable_name=value // Outside the decleration of the
class
Is there a way to that with std::map?
Regards,
map member of a class. The class I have designed id something like
this.
class Class_name{
public:
private:
.
.
void Test_Field(const string &, const string &)throw();
void Compute_Coordinates(double p)throw(); // p is the
geometrical parameter
static map<string,vector<string> > FIELDS; // Initialization
Outside of Class Declaration
};
// Initialization of Static Map Member
Mesh_Gen:FIELDS["G"].push_back("G"));
Mesh_Gen:FIELDS["G"].push_back("I"));
Mesh_Gen:FIELDS["G"].push_back("C"));
Mesh_Gen:FIELDS["G"].push_back("X"));
I tried something like this one but did not compile.
If you try to initialize a simple static member you can do that with
type Class_name::variable_name=value // Outside the decleration of the
class
Is there a way to that with std::map?
Regards,