std::chrono::month(3)
πΈ NAME πΈ
okay so this is std::chrono::month β yes, literally std::chrono::month β straight from the C++ Standard Libary (that's the manual name, bestie, and we're keeping the spelling π
). It's the calendar-month class and it is lowkey iconic. ποΈβ¨
β¨ Synopsis β¨
Defined in header <chrono>
class month; (since C++20)
inline constexpr std::chrono::month January{1}; (since C++20)
inline constexpr std::chrono::month February{2}; (since C++20)
inline constexpr std::chrono::month March{3}; (since C++20)
inline constexpr std::chrono::month April{4}; (since C++20)
inline constexpr std::chrono::month May{5}; (since C++20)
inline constexpr std::chrono::month June{6}; (since C++20)
inline constexpr std::chrono::month July{7}; (since C++20)
inline constexpr std::chrono::month August{8}; (since C++20)
inline constexpr std::chrono::month September{9}; (since C++20)
inline constexpr std::chrono::month October{10}; (since C++20)
inline constexpr std::chrono::month November{11}; (since C++20)
inline constexpr std::chrono::month December{12}; (since C++20)
So what's the vibe? The class month represents a month in a year. Its normal range is [1, 12], but it may hold any number in [0, 255] β yes, the whole byte range is invited to the party. Twelve named constants are predefined in the std::chrono namespace for the twelve months of the year. Also, month is a TriviallyCopyable StandardLayoutType β no cap, that's just the type lore. π«Ά
π Member functions π
constructorβ constructs amonth(public member function).operator++,operator++(int)β increments or decrements the month (public member function).operator--,operator--(int)β increments or decrements the month (public member function).operator+=,operator-=β adds or subtracts a number of months (public member function).operator unsignedβ retrieves the stored month value (public member function).okβ checks if the stored month value is in the normal range (public member function).
π« Nonmember functions π«
operator==β compares twomonthvalues.operator<=>β(function)(C++20). That's literally how it's listed; don't come for me. πoperator+,operator-β performs arithmetic on months (function)(C++20).operator<<β outputs amonthinto a stream(C++20)(function template).from_streamβ parses amonthfrom a stream according to the provided format(C++20)(function template).
π§ Helper classes π§
std::formatter<std::chrono::month>β formatting support formonth(C++20)(class template specialization).std::hash<std::chrono::month>β hash support forstd::chrono::month(C++26)(class template specialization).
π that's the whole tea, bestie. source: http://cppreference.com Β· version/date: 2024.06.10 Β· std::chrono::month(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