std::chrono::year::max(3)
π 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
- 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