std::string line;
This throws std::runtime_error what(): Memory exhausted
:
regex_it = boost::sregex_iterator(line.begin(), line.end(), re);
This works fine:
regex_it = boost::make_regex_iterator(line, re);
Does anyone know what is causing the difference in performance? The boost::regex lib is compiled on Linux in default non-recursive mode.
EDIT: Also tried
regex_it = boost::cregex_iterator(line.data(), line.data()+line.size(), re);
same problem.