std::chrono::year_month:: year_month
From cppreference.net
<
cpp
|
chrono
|
year month
C++
Date and time library
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::chrono::year_month
| Member functions | ||||
|
year_month::year_month
|
||||
| Nonmember functions | ||||
| Helper classes | ||||
|
(C++26)
|
|
year_month
(
)
=
default
;
|
(1) | (C++20 起) |
|
constexpr
year_month
(
const
std::
chrono
::
year
&
y,
const std:: chrono :: month & m ) noexcept ; |
(2) | (C++20 起) |
构造一个
year_month
对象。
1)
默认构造函数不初始化年份和月份。
2)
构造一个
year_month
对象,存储年份
y
和月份
m
。
注释
构造
year_month
的更便捷方式是使用
operator
/
,例如
2007y
/
std::
chrono
::
April
。
参阅
|
(C++20)
|
格里高利历日期创建的常规语法
(函数) |