我有一个 std::ostringstream。我想迭代这个 std::ostringstream 的每一行。
我使用 boost::tokenizer :
std::ostringstream HtmlStream;
.............
typedef boost::tokenizer<boost::char_separator<char> > line_tokenizer;
line_tokenizer tok(HtmlStream.str(), boost::char_separator<char>("\n\r"));
for (line_tokenizer::const_iterator i = tok.begin(), end = tok.end(); i != end; ++i)
{
std::string str = *i;
}
在线上
for (line_tokenizer::const_iterator i = tok.begin(), end = tok.end(); i != end;
我有一个“字符串迭代器不兼容”的断言错误。我已经在谷歌和 StackOverflow 上阅读过这个错误,但我很难找到我的错误。
任何人都可以帮助我吗?
非常感谢,
此致,
尼克修斯