std::chrono...eekday_last)(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– 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