std::chrono...nth_weekday)(3)
π NAME π
okay bestie, this is the std::chrono...nth_weekday)(3) page from the C++ Standard Libary manual β manual name folded in right here β and the whole page is about std::chrono::operator==(std::chrono::month_weekday). The NAME section says std::chrono::operator==(std::chrono::month_weekday) - and then repeats std::chrono::operator==(std::chrono::month_weekday) like it's giving main character energy twice. π
β¨ Synopsis β¨
Defined in header <chrono>:
constexpr bool operator==( const std::chrono::month_weekday& x,
const std::chrono::month_weekday& y )
(since C++20)
noexcept;
so it's constexpr bool operator==(...), it's since C++20, and it's noexcept;. slay. π«Ά
It compares the two month_weekday values x and y β that's literally the vibe check. π₯
The != operator is synthesized from operator==. no cap, it's not out here living its own separate life. π
π Return value π
It returns this exact expression, fr fr:
x.month() == y.month() && x.weekday_indexed() == y.weekday_indexed()
πΈ Example πΈ
// Run this code
#include <chrono>
int main()
{
constexpr auto mwdi1{std::chrono::March/std::chrono::Friday[1]};
constexpr auto mwdi2
{
std::chrono::month_weekday
{
std::chrono::month(3), std::chrono::weekday(5)[1]
}
};
static_assert(mwdi1 == mwdi2);
}
mwah π β source: http://cppreference.com, date/version: 2024.06.10, page: std::chrono...nth_weekday)(3). you're welcome, bestie πβ¨
π¦ 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