We all know that C++ inherited unsafe semantics from C, but one would expect modern library features such as std::chrono to be carefully designed to avoid the old integer conversion bugs... right?
Not the case: it's very easy to silently cause truncation or overflow in correct-looking code, such as:
set_timeout(300s);
Try to get a compile-time diagnostic or at least a run-time error for this interface:
https://godbolt.org/z/K7fYGcx8h
#cpp #programming