Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
摘自cppref:
std::time_t32 位有符号整数的实现(许多历史实现)在 2038 年失败。
std::time_t
但是,文档没有说明如何检测当前的实现是否是 2038 安全的。所以,我的问题是:
如果在 C++ 中,它是否保证 2038 安全?sizeof(std::time_t) == sizeof(std::uint64_t)
sizeof(std::time_t) == sizeof(std::uint64_t)