std::chrono...::year_month(3)

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

πŸ’– std::chrono::year_month::year_month πŸ’–

okay bestie, welcome to the C++ Standard Libary manual, section 3 β€” this page is the <pink>std::chrono...::year_month(3)</pink> one, and it's literally all about std::chrono::year_month::year_month. Yes, β€œLibary” is the spelling, don't come for me. πŸŽ€

🌸 NAME 🌸

std::chrono::year_month::year_month β€” std::chrono::year_month::year_month

πŸ¦‹ Synopsis πŸ¦‹

          year_month() = default;                                       (1)
       (since C++20)
          constexpr year_month( const std::chrono::year& y,             (2)
       (since C++20)
                                const std::chrono::month& m ) noexcept;

Constructs a year_month object. That's the whole assignment, no cap.

  1. Default constructor β€” leaves the year and month uninitialized. (Yes, literally uninitialized. It does not set them. πŸ’€)
  2. Constructs a year_month object storing the year y and the month m.

πŸŽ€ Notes πŸŽ€

A more convenient way to construct a year_month is with operator/, e.g., 2007y/std::chrono::April. It's giving shortcut slay. ✨

πŸ”₯ See also πŸ”₯

  • operator/ β€” conventional syntax for Gregorian calendar date creation (C++20) (function).

mwah πŸ’‹ β€” source: http://cppreference.com, version/date: 2024.06.10, page: std::chrono...::year_month(3). That's the cute sign-off, bestie. 🫢

πŸ“¦ where this page comes from