Namespaces
Variants

std::chrono::year:: max

From cppreference.net
static constexpr year max ( ) noexcept ;
(C++20 起)

返回最大可能的 year ,即 std:: chrono :: year ( 32767 )

返回值

std:: chrono :: year ( 32767 )

示例

#include <chrono>
#include <iostream>
int main()
{
    std::cout << "The maximum year is: " << (int)std::chrono::year::max() << '\n';
}

输出:

The maximum year is: 32767