Date: 2006-06-12 01:50 am (UTC)
Here's a theory off the top of my head: std::map doesn't do anything special for the char* data type, which you want to use as a string. You're really just mapping a pointer to an int.

The string "test" in State::State() is in a different memory location than the string "test" in GUI::GUI(). Since that pointer isn't in the map, you get the zero return value. If you had used a std::string as the key type, the strings' VALUES would have been compared and your int would have been found.

I could, of course, be wrong.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

December 2007

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526 272829
3031     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 13th, 2025 08:46 pm
Powered by Dreamwidth Studios