std::chrono...ekday_last)(3)

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

πŸ’« std::chrono::operator==(std::chrono::month_weekday_last) πŸ’«

okay so bestie, you're reading the C++ Standard Libary manual, section 3 β€” and the header title is fully std::chrono::operator==(std::chrono::month_weekday_last) - std::chrono::operator==(std::chrono::month_weekday_last). yes, it said it twice. we love a doubled title moment, no cap πŸ’…βœ¨

🌸 NAME 🌸

std::chrono::operator==(std::chrono::month_weekday_last) β€” aka std::chrono::operator==(std::chrono::month_weekday_last) (again, same name, same energy, we're not confused, it's just like that 🫢).

✨ Synopsis ✨

okay so here's the whole signature situation, and it's giving "defined in header <chrono>" realness:

Defined in header <chrono>
constexpr bool operator==( const std::chrono::month_weekday_last& x,
                           const std::chrono::month_weekday_last& y )
(since C++20)
noexcept;

This cutie compares the two month_weekday_last values x and y. and the != operator is synthesized from operator== β€” yes, it gets != for free, slay πŸ’–

πŸ’– Return value πŸ’–

it returns exactly this, bestie:

x.month() == y.month() && x.weekday_last() == y.weekday_last()

πŸŽ€ Example πŸŽ€

here's the example, copied exactly because we do not mess with code (code is sacred, fr fr):

       // Run this code

        #include <chrono>

        int main()
        {
            constexpr std::chrono::month_weekday_last mwdl1
            {
                std::chrono::March/std::chrono::Friday[std::chrono::last]
            };

            constexpr std::chrono::month_weekday_last mwdl2
            {
                std::chrono::March, std::chrono::Friday[std::chrono::last]
            };

            static_assert(mwdl1 == mwdl2);
        }

and that's the whole page, bestie! source/version is http://cppreference.com and the date is 2024.06.10 β€” bye, love you, stay constexpr πŸ§šπŸ’œβœ¨

πŸ“¦ where this page comes from