| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 成员函数 | ||||
| 非成员函数 | ||||
| 辅助类 | ||||
(C++26) |
static constexpr year max() noexcept;
|
(C++20 起) | |
返回最大的可能的 year,即 std::chrono::year(32767)。
std::chrono::year(32767)
#include <chrono>
#include <iostream>
int main()
{
std::cout << "最大年为: " << (int)std::chrono::year::max() << '\n';
}
输出:
最大年为: 32767