Thread: Assigning the content of one map to another map and doing the same with vector

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #12
    Programming Ninja In-T...
    Join Date
    May 2009
    Posts
    827
    Hmm...weird. It did become "not good" after inserting into a string from the stringstream, but it didn't do so with inserting an int into the stringstream. The statement I made earlier about checking to see if it was good() after using the operator >> wasn't exactly true, come to find out. I was checking it in one block of code, I think, but I wasn't checking it everywhere. I changed the code to check to see if stringstream::good() returned false after inserting into a string, and it did (apparently in all cases too). The weird thing is, even though, some error bit (not sure which one) was set to true, the "currentEnumeratorValue_s" string still ended up with the right value, so it outputted the right thing to file.

    EDIT: I'm thinking it was probably the "badbit". I'm going to change the code to use the bad() function instead, and see if I'm right.
    Last edited by Programmer_P; 07-12-2010 at 08:58 PM.
    I'm an alien from another world. Planet Earth is only my vacation home, and I'm not liking it.

Popular pages Recent additions subscribe to a feed