std::chrono::weekday_last:: weekday
From cppreference.net
<
cpp
|
chrono
|
weekday last
C++
Date and time library
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::chrono::weekday_last
| Member functions | ||||
|
weekday_last::weekday
|
||||
| Nonmember functions | ||||
| Helper classes | ||||
|
(C++26)
|
|
constexpr
std::
chrono
::
weekday
weekday
(
)
const
noexcept
;
|
(depuis C++20) | |
Récupère une copie de l'objet std::chrono::weekday stocké dans * this .
Valeur de retour
Une copie de l'objet std::chrono::weekday stocké dans * this .
Exemple
Exécuter ce code
#include <chrono> #include <iostream> using namespace std::chrono; int main() { std::cout << std::boolalpha; auto wdl{Tuesday[last]}; // Dernier mardi du mois std::cout << (year_month_day{wdl/10/2019} == year_month_day{October/29/2019}) << ' '; wdl = {(wdl.weekday() + days(2))[last]}; // Le dernier mardi devient maintenant le dernier jeudi std::cout << (year_month_day{wdl/10/2019} == year_month_day{October/31/2019}) << '\n'; }
Sortie :
true true