std::chrono::year_month(3)

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

πŸ’– NAME πŸ’–

std::chrono::year_month β€” std::chrono::year_month (yes bestie, that's literally the name, we move πŸ’…)

✨ Synopsis ✨

okay so this is the std::chrono::year_month(3) page from the C++ Standard Libary, and it's giving very specific calendar energy πŸ—“οΈβœ¨

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

The class year_month represents a specific month of a specific year, but with an unspecified day. It is a field-based time point, with a resolution of std::chrono::months.

year_month is a TriviallyCopyable StandardLayoutType. no cap, it's that simple 🫢

🌸 Member functions 🌸

  • constructor β€” constructs a year_month (public member function)
  • year β€” accesses the stored year and month (public member function)
  • month β€” (public member function)
  • operator+= β€” modifies the year_month by some number of months or years (public member function)
  • operator-= β€” (public member function)
  • ok β€” checks if this year_month is valid (public member function)

🌈 Nonmember functions 🌈

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

πŸŽ€ Helper classes πŸŽ€

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

made with πŸ’– on 2024.06.10 β€” source/version vibes: http://cppreference.com, page: std::chrono::year_month(3) ✨

πŸ“¦ where this page comes from