std::chrono...day_last::ok(3)
π std::chrono...day_last::ok(3) π
okay bestie, this lil page is from the C++ Standard Libary manual β yes, thatβs the spelling on the page, weβre not fixing it β and itβs all about std::chrono::weekday_last::ok. Itβs giving tiny-but-iconic, no cap. β¨
π NAME π
std::chrono::weekday_last::ok β std::chrono::weekday_last::ok
πΈ Synopsis πΈ
constexpr bool ok() const noexcept; (since C++20)
It literally checks if the weekday object stored in *this is valid. Thatβs the whole vibe check. π
π Return value π
weekday().ok()
β¨ Example β¨
// Run this code
#include <chrono>
#include <iostream>
int main()
{
std::cout << std::boolalpha;
auto wdl{std::chrono::Tuesday[std::chrono::last]};
std::cout << (wdl.ok()) << ' ';
wdl = {std::chrono::weekday(42)[std::chrono::last]};
std::cout << (wdl.ok()) << '\n';
}
Output:
true false
xoxo, bestie π this cutie came from http://cppreference.com, dated 2024.06.10, and the manual footer line is std::chrono...day_last::ok(3). π«Ά
π¦ 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