std::chrono...day_indexed)(3)
π std::chrono...day_indexed)(3) π
okay so bestie, welcome to the std::chrono...day_indexed)(3) page from the C++ Standard Libary manual. yes, we're doing chrono operator hours, and it's giving tiny-but-iconic. π
β¨ NAME β¨
std::chrono::operator==(std::chrono::weekday_indexed)β the name on the tin.std::chrono::operator==(std::chrono::weekday_indexed)β and the original page literally says it again, so here it is again, no cap. π
π¦ Synopsis π¦
Defined in header <chrono> β¨
constexpr bool operator==( const std::chrono::weekday_indexed& x,
const std::chrono::weekday_indexed& y )
This one is (since C++20) and it's noexcept; β periodt.
It compares the two weekday_indexed values x and y. The != operator is synthesized from operator==. iykyk β¨
π Return value π
This is the whole answer, no cap:
x.weekday() == y.weekday() && x.index() == y.index()
π Example π
// Run this code
#include <chrono>
int main()
{
constexpr std::chrono::weekday_indexed
wdi1{std::chrono::Wednesday[2]};
constexpr std::chrono::weekday_indexed
wdi2{std::chrono::weekday(3), 2};
static_assert(wdi1 == wdi2);
}
That static_assert ate, fr fr. π«Ά
xoxo bestie π source is http://cppreference.com, dated 2024.06.10, and the footer tag is std::chrono...day_indexed)(3). bye! π¦
π¦ 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