std::chrono:: operator+, std::chrono:: operator- (std::chrono::year_month_weekday_last)
|
constexpr
std::
chrono
::
year_month_weekday_last
operator
+
(
const
std::
chrono
::
year_month_weekday_last
&
ymwdl,
|
(seit C++20) | |
|
constexpr
std::
chrono
::
year_month_weekday_last
operator
+
(
const
std::
chrono
::
months
&
dm,
|
(seit C++20) | |
|
constexpr
std::
chrono
::
year_month_weekday_last
operator
+
(
const
std::
chrono
::
year_month_weekday_last
&
ymwdl,
|
(seit C++20) | |
|
constexpr
std::
chrono
::
year_month_weekday_last
operator
+
(
const
std::
chrono
::
years
&
dy,
|
(seit C++20) | |
|
constexpr
std::
chrono
::
year_month_weekday_last
operator
-
(
const
std::
chrono
::
year_month_weekday_last
&
ymwdl,
|
(seit C++20) | |
|
constexpr
std::
chrono
::
year_month_weekday_last
operator
-
(
const
std::
chrono
::
year_month_weekday_last
&
ymwdl,
|
(seit C++20) | |
year()
und
month()
wie
std::
chrono
::
year_month
(
ymwdl.
year
(
)
, ymwdl.
month
(
)
)
+
dm
und denselben
weekday()
wie
ymwdl
.
Für Zeitdauern, die sowohl in
std::chrono::years
als auch in
std::chrono::months
konvertierbar sind, werden die
years
Überladungen
(3,4,6)
bevorzugt, wenn der Aufruf andernfalls mehrdeutig wäre.
Beispiel
#include <cassert> #include <chrono> using namespace std::chrono; int main() { constexpr auto ymwdl1{Tuesday[last]/11/2021}; auto ymwdl2 = ymwdl1; ymwdl2 = std::chrono::months(12) + ymwdl2; ymwdl2 = ymwdl2 - std::chrono::years(1); assert(ymwdl1 == ymwdl2); }