名前空間
変種
操作

std::chrono::year::max

From cppreference.com
< cpp‎ | chrono‎ | year
 
 
 
 
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
English 日本語 中文(简体) 中文(繁體)