Namespaces
Variants

std::chrono::year_month_weekday:: year_month_weekday

From cppreference.net
year_month_weekday ( ) = default ;
(1) (自 C++20 起)
constexpr year_month_weekday ( const std:: chrono :: year & y,

const std:: chrono :: month & m,

const std:: chrono :: weekday_indexed & wdi ) noexcept ;
(2) (自 C++20 起)
constexpr year_month_weekday ( const std:: chrono :: sys_days & dp ) noexcept ;
(3) (自 C++20 起)
constexpr explicit year_month_weekday ( const std:: chrono :: local_days & dp ) noexcept ;
(4) (自 C++20 起)

构造一个 year_month_weekday 对象。

1) 默认构造函数不初始化字段。
2) 构造一个 year_month_weekday 对象,存储年份 y 、月份 m 、星期几 wdi. weekday ( ) 以及星期索引 wdi. index ( )
3) 构造一个与 dp 所表示日期对应的 year_month_weekday 对象。对于存储有效日期的任何 year_month_weekday 对象,将其转换为 sys_days 再转换回原类型将得到相同的值。此构造函数定义了从 sys_days year_month_weekday 的隐式转换。
4) 构造一个与 dp 所表示日期对应的 year_month_weekday 对象。等价于 year_month_weekday ( sys_days ( dp. time_since_epoch ( ) ) )

注释

一个 year_month_weekday 也可以通过使用 operator/ 将部分日期类型 std::chrono::year_month std::chrono::month_weekday 之一与缺失的组成部分(分别为索引工作日和年份)组合来创建。

参见

(C++20)
格里高利历日期创建的常规语法
(函数)