std::chrono...onth_weekday(3)
π NAME π
std::chrono::year_month_weekday::year_month_weekday β std::chrono::year_month_weekday::year_month_weekday
okay so bestie, this is the constructor page for std::chrono::year_month_weekday, coming at you from the C++ Standard Libary manual, page std::chrono...onth_weekday(3). Itβs literally the βbuild me a year_month_weekday objectβ page, and it has four constructors, all since C++20. π
β¨ Synopsis β¨
The constructors are:
- (1) (since C++20)
year_month_weekday() = default;
- (2) (since C++20)
constexpr year_month_weekday( const std::chrono::year& y,
const std::chrono::month& m,
const std::chrono::weekday_indexed& wdi ) noexcept;
- (3) (since C++20)
constexpr year_month_weekday( const std::chrono::sys_days& dp ) noexcept;
- (4) (since C++20)
constexpr explicit year_month_weekday( const std::chrono::local_days& dp ) noexcept;
Constructs a year_month_weekday object. Letβs break the four flavors down, bestie:
- (1) Default constructor leaves the fields uninitialized. No cap, thatβs the whole caveat: it does not secretly fill them in for you π.
- (2) Constructs a
year_month_weekdayobject storing the yeary, the monthm, the weekdaywdi.weekday()and the weekday indexwdi.index(). - (3) Constructs a
year_month_weekdayobject corresponding to the date represented bydp. For anyyear_month_weekdayobject storing a valid date, converting it tosys_daysand back yields the same value. This constructor defines an implicit conversion fromsys_daystoyear_month_weekday. - (4) Constructs a
year_month_weekdayobject corresponding to the date represented bydp. Equivalent toyear_month_weekday(sys_days(dp.time_since_epoch())).
π Notes π
A year_month_weekday can also be created by combining one of the partial-date types std::chrono::year_month and std::chrono::month_weekday with the missing component (indexed weekday and year, respectively) using operator/. Thatβs the cute little calendar-builder move, iykyk π.
π See also π
operator/β conventional syntax for Gregorian calendar date creation (C++20) (function).
bye bestie π«Ά this page came from http://cppreference.com, version/date 2024.06.10, and the page/manual name is std::chrono...onth_weekday(3). π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms