std::chrono::year::max(3)

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

πŸŽ€ std::chrono::year::max πŸŽ€

okay so bestie, this is the std::chrono::year::max(3) page from the C++ Standard Libary manual (yes, "Libary" exactly like that, we're keeping it). it's giving tiny-but-iconic constexpr energy, and we're gonna get through it together. πŸ’…


✨ NAME ✨

std::chrono::year::max - std::chrono::year::max

like... that's the name, that's the whole name, and honestly? she said what she said. πŸ‘‘


πŸ“œ Synopsis πŸ“œ

static constexpr year max() noexcept;  (since C++20)

so yeah: static constexpr, max(), noexcept, and it's been here since C++20. no notes, periodt. ✨


πŸ’– Return value πŸ’–

std::chrono::year(32767)

translation: it returns the largest possible year, that is, std::chrono::year(32767). no cap, that's the whole return value, and it's literally the max. πŸ”₯


πŸ¦‹ Example πŸ¦‹

run this code, bestie:

       // Run this code

        #include <chrono>
        #include <iostream>

        int main()
        {
            std::cout << "The maximum year is: " <<
       (int)std::chrono::year::max() << '\n';
        }

🌈 Output 🌈

        The maximum year is: 32767

cute, clean, and it ate. no crumbs. πŸ“


k that's the whole page, bestie. source/version/date tea: http://cppreference.com, 2024.06.10, page std::chrono::year::max(3). now go flex that max year knowledge, mwah πŸ’–βœ¨πŸ«Ά

πŸ“¦ where this page comes from