diff --git a/dune/perftool/common/tsc.cc b/dune/perftool/common/tsc.cc index 999eee11a6900800fa11745bb9d3bdb39f9c468b..42616419e4c1e716c4ffc8c96b57c7ccc307d51b 100644 --- a/dune/perftool/common/tsc.cc +++ b/dune/perftool/common/tsc.cc @@ -1,6 +1,7 @@ #include "config.h" #include <regex> +#include <fstream> #include <iostream> #include <algorithm> #include <vector> @@ -113,13 +114,14 @@ namespace Dune { { double result = -1.0; try { - auto cpuinfo = std::ifstream("/proc/cpuinfo"); + std::ifstream cpuinfo("/proc/cpuinfo"); auto re = std::regex("bogomips\\s:\\s(\\d+\\.\\d+)$"); + auto match = std::smatch(); using std::getline; for (std::string line ; getline(cpuinfo,line) ; ) { - if (auto match = std::smatch() ; std::regex_match(line,match,re)) + if (std::regex_match(line,match,re)) { result = 5e5 * std::stod(match[1].str()); break;