std::chrono::year:: max
From cppreference.net
C++
Date and time library
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::chrono::year
| Member functions | ||||
|
year::max
|
||||
| Nonmember functions | ||||
| Helper classes | ||||
|
(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 << "The maximum year is: " << (int)std::chrono::year::max() << '\n'; }
输出:
The maximum year is: 32767