I'm having trouble with some code from a C++ project. It includes the std::chrono
library and keeps breaking at the following assertion:
static_assert(system_clock::duration::min() < system_clock::duration::zero(), "a clock's minimum duration cannot be less than its epoch");
The assert breaks the code in both a Debian machine with g++ 6.3.0 and in a PC with Windows 10, CygWin and g++ 7.3.0. I've also tried in an online C++ compiler a simple example including the chrono library, which by itself does not give any problems, but when comparing manually the minimum and zero duration of the chrono system clock gives the result that should trigger the assert as well.
I've searched about the issue and found some clues leading to some related problems caused by the TZ posix variable that holds timezone info. Tried unsetting and setting it to its right value, yet it had no effects on the assert.
I'd appreciate any pointers or suggestions.
Edit: While std::chrono::milliseconds::zero() has a (as expected) value of 0, the value of std::chrono::milliseconds::min() is -9223372036854775808, or -2^63 which i think is the minimum possible value for a long long value (possible overflow?).