Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-08-07 12:31:43


AMDG

Daryl Lilburn wrote:
> A colleague has recently discovered a problem using tokenizer
> with the output from a std::stringstream class in VC8. If we do
> the following, we get an "ITERATOR LIST CORRUPTED" exception
> thrown:

I can't reproduce this. The following works with vc8 using
1.33.1, 1.34.1, 1.35, and 1.36. If I pass oss.str directly to
the constructor of strList, I get, _DEBUG_ERROR("string iterators
incompatible");

#include <boost/tokenizer.hpp>
#include <sstream>

typedef boost::char_separator<char> Separators;
typedef boost::tokenizer<Separators > Tokens;
 
int main() {

    std::string str1("ABC");
    std::string str2("DEF");
    std::stringstream oss;
    oss << str1 << "," << str2;

    std::string tempStr(oss.str());
    Tokens strList(tempStr, Separators(",|"));
    Tokens::const_iterator strIter = strList.begin(); // exception
thrown here

}

What version of boost are you using?
Can you post a complete compilable example of your problem?

In Christ,
Steven Watanabe


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