std::chrono::weekday_indexed:: index
From cppreference.net
<
cpp
|
chrono
|
weekday indexed
C++
Date and time library
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::chrono::weekday_indexed
| Member functions | ||||
|
weekday_indexed::index
|
||||
| Nonmember functions | ||||
| Helper classes | ||||
|
constexpr
unsigned
index
(
)
const
noexcept
;
|
(seit C++20) | |
Greift auf den in * this gespeicherten Index zu.
Rückgabewert
Der in * this gespeicherte Index.
Beispiel
Diesen Code ausführen
#include <chrono> #include <iostream> int main() { std::cout << std::boolalpha; std::chrono::weekday_indexed wdi {std::chrono::Tuesday[2]}; // 2. Dienstag eines Monats std::cout << (std::chrono::year_month_day{wdi/10/2019} == std::chrono::year_month_day{std::chrono::October/8/2019}) << ' '; wdi = {wdi.weekday()[wdi.index() + 2]}; // 2. Dienstag => 4. Dienstag std::cout << (std::chrono::year_month_day{wdi/10/2019} == std::chrono::year_month_day{std::chrono::October/22/2019}) << '\n'; }
Ausgabe:
true true