std::chrono...th_day_last)(3)
π NAME
okay bestie, welcome to the std::chrono...th_day_last)(3) page from the C++ Standard Libary manual β yes, thatβs the manual name, folded in near the top like a lil bookmark instead of copying the header line. The name is std::chrono::operator==,(std::chrono::month_day_last) β dash β std::chrono::operator==,(std::chrono::month_day_last). That comma after == is literally part of the listed name, so weβre keeping it. Periodt. π
β¨ Synopsis
First things first: the manual says Defined in header <chrono>. π¦ Lowkey iconic. Here are the overloads, with the literal code bits kept exactly as given:
Defined in header <chrono>
constexpr bool operator==( const std::chrono::month_day_last& x,
const std::chrono::month_day_last& y )
(1) (since C++20)
noexcept;
constexpr std::strong_ordering operator<=>( const
std::chrono::month_day_last& x,
(2) (since C++20)
const
std::chrono::month_day_last& y ) noexcept;
Overload (1) is the == one, since C++20. Overload (2) is the <=> one, also since C++20. Both are noexcept, bestie β no cap. π
So what does it do? It compares the two month_day_last values x and y β thatβs the whole vibe. The <, <=, >, >=, and != operators are synthesized from operator<=> and operator== respectively. Cute, efficient, very main character energy. β¨
π Return value
x.month() == y.month()x.month() <=> y.month()
πΈ Example
Run this code, fr fr:
// Run this code
#include <chrono>
#include <iostream>
int main()
{
constexpr auto mdl1{std::chrono::February/std::chrono::last};
constexpr std::chrono::month_day_last mdl2{std::chrono::month(2)};
std::cout << std::boolalpha << (mdl1 == mdl2) << '\n';
static_assert(mdl1 <= mdl2);
}
β Output
true
Thatβs the whole page, bestie! Big shoutout to http://cppreference.com, version/date 2024.06.10, and the page tag std::chrono...th_day_last)(3) β mwah ππ
π¦ 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