std::chrono::year_month_weekday_last::operator+=, std::chrono::year_month_weekday_last::operator-=
Von cppreference.com
< cpp | chrono | year month weekday last
| constexpr std::chrono::year_month_weekday_last& operator+=( const std::chrono::years& dy ) const noexcept; |
(1) | (seit C++20) |
| constexpr std::chrono::year_month_weekday_last& operator+=( const std::chrono::months& dm ) const noexcept; |
(2) | (seit C++20) |
| constexpr std::chrono::year_month_weekday_last& operator-=( const std::chrono::years& dy ) const noexcept; |
(3) | (seit C++20) |
| constexpr std::chrono::year_month_weekday_last& operator-=( const std::chrono::months& dm ) const noexcept; |
(4) | (seit C++20) |
Modifiziert den Zeitpunkte, den *this repräsentiert, um die Dauer dy oder dm.
1) Äquivalent zu *this = *this + dy;.
2) Äquivalent zu *this = *this + dm;.
3) Äquivalent zu *this = *this - dy;.
4) Äquivalent zu *this = *this - dm;.
Für Dauern, die sowohl in std::chrono::years als auch in std::chrono::months konvertierbar sind, werden die `years`-Überladungen (1,3) bevorzugt, wenn der Aufruf ansonsten mehrdeutig wäre.
[Bearbeiten] Beispiel
Führen Sie diesen Code aus
Ausgabe
2022-08-26 2022-10-28 2021-10-29
[Bearbeiten] Siehe auch
| (C++20) |
addiert oder subtrahiert einen year_month_weekday_last und eine Anzahl von Jahren oder Monaten(Funktion) |