std::chrono...weekday::ok(3)
π¦ std::chrono...weekday::ok(3) π¦
okay so bestie, this page comes from the C++ Standard Libary manual, and the title is std::chrono...weekday::ok(3). The NAME section is out here calling it std::chrono::month_weekday::ok, so keep both names in mind β iykyk π
.
β¨ NAME β¨
std::chrono::month_weekday::ok - std::chrono::month_weekday::ok
πΈ Synopsis πΈ
constexpr bool ok() const noexcept; (since C++20)
This little icon checks whether the contained month and weekday_indexed objects are valid. Itβs giving vibe check for both of them, periodt β¨.
π Return value π
It returns exactly this:
month().ok() && weekday_indexed().ok()
No cap, thatβs the whole return value π.
π Example π
Hereβs the example, bestie β go run it and let the asserts do their thing π«Ά:
// Run this code
#include <cassert>
#include <chrono>
int main()
{
auto mwdi{std::chrono::March/std::chrono::Friday[1]};
assert(mwdi.ok());
mwdi = {std::chrono::month(17)/std::chrono::Friday[1]};
assert(not mwdi.ok());
mwdi = {std::chrono::March/std::chrono::Friday[-4]};
assert(not mwdi.ok());
}
Source: http://cppreference.com Β· version/date: 2024.06.10 Β· bye bestie, go flex that valid month_weekday energy π
β¨
π¦ 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