When I retrieve the begin() iterator of a boost::tokenizer, I get a crash in msvcp90d.dll, that says "ITERATOR LIST CORRUPTED", which looks suspiciously like issues I have run into before with the _HAS_ITERATOR_DEBUGGING compiler flag, however I have verified that my program is being compiled with this flag turned off.
Here is the program:
#include <sstream>
#include <boost/tokenizer.hpp>
#include <boost/algorithm/string.hpp>
int main(int argc, char* argv[])
{
std::string data("gobo;wimbley;red;moki;boober");
std::ostringstream input;
input << data;
std::string mystr(input.str());
boost::char_separator<char> separator(";");
boost::tokenizer<boost::char_separator<char>> tok(mystr, separator);
boost::tokenizer<boost::char_separator<char>>::iterator iter = tok.begin();
}
Interestingly, if I replace the instantiation of the tokenizer with the following line, it works:
boost::tokenizer<boost::char_separator<char>> tok(data, separator);
So it appears to be something related to the ostringstream. Any ideas?