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,
|
(начиная с C++20) | |
|
constexpr
std::
chrono
::
year_month_weekday_last
operator
+
(
const
std::
chrono
::
months
&
dm,
|
(начиная с C++20) | |
|
constexpr
std::
chrono
::
year_month_weekday_last
operator
+
(
const
std::
chrono
::
year_month_weekday_last
&
ymwdl,
|
(начиная с C++20) | |
|
constexpr
std::
chrono
::
year_month_weekday_last
operator
+
(
const
std::
chrono
::
years
&
dy,
|
(начиная с C++20) | |
|
constexpr
std::
chrono
::
year_month_weekday_last
operator
-
(
const
std::
chrono
::
year_month_weekday_last
&
ymwdl,
|
(начиная с C++20) | |
|
constexpr
std::
chrono
::
year_month_weekday_last
operator
-
(
const
std::
chrono
::
year_month_weekday_last
&
ymwdl,
|
(начиная с C++20) | |
year()
и
month()
, что и
std::
chrono
::
year_month
(
ymwdl.
year
(
)
, ymwdl.
month
(
)
)
+
dm
, и тот же
weekday()
, что и
ymwdl
.
Для длительностей, которые конвертируются как в
std::chrono::years
, так и в
std::chrono::months
, перегрузки
years
(3,4,6)
имеют приоритет, если вызов иначе был бы неоднозначным.
Пример
#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); }