Boost logo

Boost Users :

From: Daryl Lilburn (dlilb300_at_[hidden])
Date: 2008-08-07 02:36:32


Hi, A colleague has recently discovered a problem using tokenizerwith the output from a std::stringstream class in VC8. If we dothe following, we get an "ITERATOR LIST CORRUPTED" exceptionthrown: typedef boost::char_separator<char> Separators;typedef boost::tokenizer<Separators > Tokens; std::string str1("ABC");std::string str2("DEF");std::stringstream oss;oss << str1 << "," << str2; Tokens strList(oss.str(), Separators(",|"));Tokens::const_iterator strIter = strList.begin(); // exception thrown here I thought this might be because the string returned from oss.str() is temporaryso I tried the following change and it still failed: std::string tempStr(oss.str());Tokens strList(tempStr, Separators(",|"));Tokens::const_iterator strIter = strList.begin(); // exception thrown here Finally I tried this and it succeeded. std::string tempStr;oss >> tempStr;Tokens strList(tempStr, Separators(",|"));Tokens::const_iterator strIter = strList.begin(); // exception thrown here Can anyone tell me why the first two (in particular the second option) failed? RegardsDaryl Lilburn
_________________________________________________________________
Are you paid what you're worth? Find out: SEEK Salary Centre
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau%2Fcareer%2Dresources%2Fsalary%2Dcentre%2F%3Ftracking%3Dsk%3Ahet%3Asc%3Anine%3A0%3Ahot%3Atext&_t=764565661&_r=OCT07_endtext_salary&_m=EXT



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net