std::chrono...weekday_last(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– NAME πŸ’–

Okay bestie, this page is from the C++ Standard Library manual, and the page is std::chrono...weekday_last(3). The star of the show is std::chrono::month_weekday_last::month_weekday_last β€” yes, the name is a whole snack and a half, but it's the month_weekday_last constructor. πŸ’…


✨ Synopsis ✨

Here's the exact signature, no cap:

constexpr month_weekday_last( const std::chrono::month& m,
                              const std::chrono::weekday_last& wdl )
(since C++20)
noexcept;

So it's constexpr, it's noexcept;, and it's been around since C++20. 🫢


πŸŽ€ Notes πŸŽ€

A more convenient way to construct a month_weekday_last is with operator/, e.g.:

std::chrono::April/std::chrono::Sunday[std::chrono::last]

It literally constructs a month_weekday_last object that stores the month m and the weekday_last wdl. That's the whole vibe. πŸ¦‹


πŸ¦‹ See also πŸ¦‹

  • operator/ β€” conventional syntax for Gregorian calendar date creation (C++20) (function). iconic behavior, honestly. πŸ‘‘

Cute little sign-off: source is http://cppreference.com, version/date is 2024.06.10, and the manual is std::chrono...weekday_last(3). Stay slay, stay noexcept; πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from