Avoid creating and destroying a std::string on every iteration.