Commit a50cef7f authored by Ivan Vilata-i-Balaguer's avatar Ivan Vilata-i-Balaguer
Browse files

Avoid `std::chrono::ceil` altogether.

It does not seem to be available in some implementations of the C++1z draft
that do not implement the whole C++17.
parent a280ac0d
......@@ -135,7 +135,10 @@ private:
auto now = steady_clock::now();
auto buggy_refresh = *earlier_buggy_timeout + timeout_pause;
if (buggy_refresh < now) return seconds(0);
return std::chrono::ceil<seconds>(buggy_refresh - now);
return [] (auto d) { // std::chrono::ceil not in c++1z
auto t = duration_cast<seconds>(d);
return t + seconds(t < d ? 1 : 0);
}(buggy_refresh - now);
}
// Wait until a little before mappings would time out to refresh them.
auto round_elapsed = steady_clock::now() - round_begin;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment