std::chrono...day_last::ok(3)

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

πŸ’– 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