std::chrono...eekday_last)(3)
π NAME
okay so this is the std::chrono...eekday_last)(3) page, bestie β the C++ Standard Library manual for std::chrono::operator==(std::chrono::year_month_weekday_last). Itβs literally the equality operator for std::chrono::year_month_weekday_last, and weβre gonna vibe through it together, no cap. π«Ά
β¨ Synopsis β¨
this is the whole thing, and the (since C++20) is doing main character energy:
Defined in header <chrono>
constexpr bool operator==( const
std::chrono::year_month_weekday_last& x,
(since C++20)
const
std::chrono::year_month_weekday_last& y ) noexcept;
so it compares the two year_month_weekday_last values x and y β iconic. and the != operator? itβs synthesized from operator==, periodt. π
π Return value π
it gives you this exact expression, no cap:
x.year() == y.year() && x.month() == y.month() && x.weekday() ==
y.weekday()
which is giving βtrue only when year, month, and weekday all line upβ energy β¨
π Example π
// Run this code
#include <chrono>
#include <iostream>
using namespace std::chrono;
int main()
{
constexpr auto ymwdl1{Tuesday[last]/11/2021};
auto ymwdl2 = Tuesday[last]/11/2020;
ymwdl2 += months(12);
std::cout << std::boolalpha << (ymwdl1 == ymwdl2) << '\n';
}
π Output π
true
and thatβs the whole slay, bestie π¦ mwah π this page came from http://cppreference.com, version/date 2024.06.10, and itβs the std::chrono...eekday_last)(3) manual page β periodt. π
π¦ 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