I'm a bit stumped with, what I thought was, some simple code. It was previously working, so I wasn't sure why it stopped working. This is a single threaded program.
Model *model;
ModelMap::iterator model_map_iterator;
cout << this->models.size() << endl;
for( model_map_iterator = this->models.begin(); model_map_iterator != this->models.end(); model_map_iterator++ ){
cout << "what" << endl;
//model = model_map_iterator->second;
//cout << *model;
}
cout << this->models.size() << endl;
And here's the output when there's 1, 2 and 4 models, respectively.
$ program
1
what
1
$ program
2
what
what
2
$ program
4
what
what
4
As you can see, for any number of models greater than 2, the number of "what" outputs is 2. I've tried it for 2-5 models. All of them produce two "what" strings, yet output the correct size of the std::map.
Could anyone please help me find out what I'm doing wrong?
Thanks in advance...
UPDATE:
Committed entire codebase for debugging:
https://github.com/homer6/modeler/tree/crudepythonmodeler
commit ( 00c01ad634df70cc7f67efba96b1503ffd63529c )
it's the crudepythonmodeler branch
README.md contains the install steps for ubuntu