std::string line;
这抛出std::runtime_error what(): Memory exhausted
:
regex_it = boost::sregex_iterator(line.begin(), line.end(), re);
这工作正常:
regex_it = boost::make_regex_iterator(line, re);
有谁知道导致性能差异的原因是什么?boost::regex 库在 Linux 上以默认的非递归模式编译。
编辑:也试过
regex_it = boost::cregex_iterator(line.data(), line.data()+line.size(), re);
同样的问题。