std::chrono::year_month_weekday_last:: operator+=, std::chrono::year_month_weekday_last:: operator-=
From cppreference.net
<
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 Zeitpunkt, den * this repräsentiert, um die Dauer dy oder dm .
1)
Entspricht
*
this
=
*
this
+
dy
;
.
2)
Entspricht
*
this
=
*
this
+
dm
;
.
3)
Entspricht
*
this
=
*
this
-
dy
;
.
4)
Entspricht
*
this
=
*
this
-
dm
;
.
Für Zeitdauern, die sowohl in
std::chrono::years
als auch in
std::chrono::months
konvertierbar sind, werden die
years
Überladungen
(1,3)
bevorzugt, falls der Aufruf andernfalls mehrdeutig wäre.
Beispiel
Diesen Code ausführen
Ausgabe:
2022-08-26 2022-10-28 2021-10-29
Siehe auch
|
(C++20)
|
addiert oder subtrahiert ein
year_month_weekday_last
und eine Anzahl von Jahren oder Monaten
(Funktion) |