Today I've been trying to seperate a class so all the function definitions are in the cpp file, like they're supposed to be, with only the class definition in the header file. Don't complain that I should have started off that way: I admit I'm a retard.
I've run into a problem with the map I'm using and I think I've isolated it down to a scoping problem, maybe. I have a map defined in the public part of CLASS (ie in the header file):
Then I've declared it again in the CLASS.cpp file as:Code:static std::map<string,string> params;
When I try to assign to it in one of the class functions it fails. I've made sure there is memory for it and such. Just to make it obvious what I'm doing:Code:std::map<string, string> CLASS::params;
Simple, eh?Code:void CLASS::save_param( char *_nvpair ) { params["bob"] = "bill"; // assign to the map<> std::cout<< ((params.size())?"yea":"ney"); }
I know that the assign fails because params.size() returns 0.
The actual point the code fails at is apparently line 988 in xtree:
I thought I sorted this problem before, but splitting up the code is giving me flashbacks. Any help would be welcomed with a crushing (but friendly) bear hug.Code:_Nodeptr _Lbound(const key_type& _Keyval) const { // find leftmost node not less than _Keyval _Nodeptr _Pnode = _Root(); // <- this line ...



LinkBack URL
About LinkBacks



