命名空间
变体
操作

std::chrono::year::max

来自 cppreference.cn
< cpp‎ | chrono‎ | year
 
 
 
 
static constexpr year max() noexcept;
(since 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