std::chrono::month_day(3)

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

✨ std::chrono::month_day ✨

Okay bestie, this is from the C++ Standard Libary manual (yes, that spelling is in the header β€” we keep it πŸ’…), and the page is std::chrono::month_day(3). Let’s get into it.

πŸ’– NAME πŸ’–

std::chrono::month_day β€” std::chrono::month_day (the name and the description are literally twins, we love a consistent icon πŸŽ€).

🌸 Synopsis 🌸

Defined in header <chrono>
class month_day;            (since C++20)

So month_day represents a specific day of a specific month, of some yet to be specified year. TBD year energy, honestly. And month_day is a TriviallyCopyable StandardLayoutType β€” both, no cap ✨.

🫢 Member functions 🫢

  • constructor β€” constructs a month_day (public member function)
  • month / day β€” retrieve the stored month and day values (public member functions)
  • ok β€” checks if the month_day is valid (public member function)

πŸ’« Nonmember functions πŸ’«

  • operator== β€” compares two month_day values (function)
  • operator<=> β€” (C++20) (function)
  • operator<< β€” outputs a month_day into a stream (C++20) (function template)
  • from_stream β€” parses a month_day from a stream according to the provided format (C++20) (function template)

🧚 Helper classes 🧚

  • std::formatter<std::chrono::month_day> β€” formatting support for month_day (C++20) (class template specialization)
  • std::hash<std::chrono::month_day> β€” hash support for std::chrono::month_day (C++26) (class template specialization)

Source/version/date check, bestie: this came from http://cppreference.com, dated 2024.06.10, and the manual page is std::chrono::month_day(3). Slay, go be the main character of your own month-and-day combo πŸ’–πŸ¦‹

πŸ“¦ where this page comes from