std::chrono...day_last::ok(3)
π NAME π
okay bestie, this is the manual page for std::chrono::month_weekday_last::ok, from the C++ Standard Libary manual. The header is doing its abbreviated thing with std::chrono...day_last::ok, iykyk, but the full function name is the one above and the NAME line repeats it as std::chrono::month_weekday_last::ok - std::chrono::month_weekday_last::ok.
β¨ Synopsis β¨
Here's the whole signature with its C++20 glow-up, copied exactly:
constexpr bool ok() const noexcept; (since C++20)
It checks if the contained month and weekday_last objects are valid. That's literally the whole vibe check, no cap.
π«Ά Return value π«Ά
This returns:
month().ok() && weekday_last().ok()
So yeah β it's the "both of these need to pass" situation, expressed exactly like the original. π
πΈ Example πΈ
Here's the example, kept exactly as it appears β including the manual's slightly chaotic line wraps, because we do not edit source code in this group chat:
// Run this code
#include <chrono>
#include <iostream>
int main()
{
std::cout << std::boolalpha;
auto
mwdl{std::chrono::March/std::chrono::Wednesday[std::chrono::last]};
std::cout << (mwdl.ok()) << ' ';
mwdl =
{std::chrono::month(3)/std::chrono::weekday(42)[std::chrono::last]};
std::cout << (mwdl.ok()) << '\n';
}
Output:
true false
π sign-off: source/version http://cppreference.com; date 2024.06.10. That's the end of the std::chrono...day_last::ok(3) page, bestie β periodt π
π¦ 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