std::chrono::month_weekday:: ok
From cppreference.net
<
cpp
|
chrono
|
month weekday
C++
Date and time library
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::chrono::month_weekday
| Member functions | ||||
|
month_weekday::ok
|
||||
| Nonmember functions | ||||
| Helper classes | ||||
|
constexpr
bool
ok
(
)
const
noexcept
;
|
(depuis C++20) | |
Vérifie si les objets month et weekday_indexed contenus sont valides.
Valeur de retour
month ( ) . ok ( ) && weekday_indexed ( ) . ok ( )
Exemple
Exécuter ce 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()); }