std::chrono::year_month_weekday::operator+=,std::chrono::year_month_weekday::operator-= (3) - Linux Manuals
std::chrono::year_month_weekday::operator+=,std::chrono::year_month_weekday::operator-=: std::chrono::year_month_weekday::operator+=,std::chrono::year_month_weekday::operator-=
Command to display std::chrono::year_month_weekday::operator+=,std::chrono::year_month_weekday::operator-=
manual in Linux: $ man 3 std::chrono::year_month_weekday::operator+=,std::chrono::year_month_weekday::operator-=
NAME
std::chrono::year_month_weekday::operator+=,std::chrono::year_month_weekday::operator-= - std::chrono::year_month_weekday::operator+=,std::chrono::year_month_weekday::operator-=
Synopsis
constexpr std::chrono::year_month_weekday& operator+=(const std::chrono::years& dy) const noexcept; (1) (since C++20)
constexpr std::chrono::year_month_weekday& operator+=(const std::chrono::months& dm) const noexcept; (2) (since C++20)
constexpr std::chrono::year_month_weekday& operator-=(const std::chrono::years& dy) const noexcept; (3) (since C++20)
constexpr std::chrono::year_month_weekday& operator-=(const std::chrono::months& dm) const noexcept; (4) (since C++20)
Modifies the time point *this represents by the duration dy or dm.
1) Equivalent to *this = *this + dy;
2) Equivalent to *this = *this + dm;
3) Equivalent to *this = *this - dy;
4) Equivalent to *this = *this - dm;
Notes
Durations that are convertible to std::chrono::months, but not std::chrono::years, can be directly added to or subtracted from a year_month_weekday. Durations convertible to std::chrono::years cannot because such durations are also convertible to std::chrono::months, resulting in an ambiguity:
using namespace std::chrono;
using decades = duration<int, std::ratio_multiply<std::ratio<10>, years::period>>;
using kilomonths = duration<int, std::ratio_multiply<std::kilo, months::period>>;
auto ymwd = 2001y/April/Sunday[1];
ymwd += decades{1}; // error, ambiguous
ymwd += kilomonths{1}; // OK
See also
adds or subtracts a year_month_weekday and some number of years or months
operator+ (function)
operator-
Pages related to std::chrono::year_month_weekday::operator+=,std::chrono::year_month_weekday::operator-=
- std::chrono::year_month_weekday::operatorsys_days, (3) - std::chrono::year_month_weekday::operatorsys_days,
- std::chrono::year_month_weekday::operatorsys_days,std::chrono::year_month_weekday::operatorlocal_days (3) - std::chrono::year_month_weekday::operatorsys_days,std::chrono::year_month_weekday::operatorlocal_days
- std::chrono::year_month_weekday::ok (3) - std::chrono::year_month_weekday::ok
- std::chrono::year_month_weekday::year,std::chrono::year_month_weekday::month, (3) - std::chrono::year_month_weekday::year,std::chrono::year_month_weekday::month,
- std::chrono::year_month_weekday::year_month_weekday (3) - std::chrono::year_month_weekday::year_month_weekday
- std::chrono::year_month_weekday (3) - std::chrono::year_month_weekday
- std::chrono::year_month_weekday_last (3) - std::chrono::year_month_weekday_last
- std::chrono::year_month_weekday_last::ok (3) - std::chrono::year_month_weekday_last::ok
- std::chrono::year_month_weekday_last::operator+=, (3) - std::chrono::year_month_weekday_last::operator+=,
- std::chrono::year_month_weekday_last::operator+=,std::chrono::year_month_weekday_last::operator-= (3) - std::chrono::year_month_weekday_last::operator+=,std::chrono::year_month_weekday_last::operator-=
- std::chrono::year_month_weekday_last::operatorsys_days, (3) - std::chrono::year_month_weekday_last::operatorsys_days,
- std::chrono::year_month_weekday_last::operatorsys_days,std::chrono::year_month_weekday_last::operatorlocal_days (3) - std::chrono::year_month_weekday_last::operatorsys_days,std::chrono::year_month_weekday_last::operatorlocal_days
- std::chrono::year_month_weekday_last::year,std::chrono::year_month_weekday_last::month, (3) - std::chrono::year_month_weekday_last::year,std::chrono::year_month_weekday_last::month,
- std::chrono::year_month_weekday_last::year_month_weekday_last (3) - std::chrono::year_month_weekday_last::year_month_weekday_last
- std::chrono::year_month_day (3) - std::chrono::year_month_day
- std::chrono::year_month_day::ok (3) - std::chrono::year_month_day::ok
- std::chrono::year_month_day::operator+=,std::chrono::year_month_day::operator-= (3) - std::chrono::year_month_day::operator+=,std::chrono::year_month_day::operator-=
- std::chrono::year_month_day::operatorsys_days,std::chrono::year_month_day::operator (3) - std::chrono::year_month_day::operatorsys_days,std::chrono::year_month_day::operator
- std::chrono::year_month_day::operatorsys_days,std::chrono::year_month_day::operatorlocal_days (3) - std::chrono::year_month_day::operatorsys_days,std::chrono::year_month_day::operatorlocal_days
- std::chrono::year_month_day::year,std::chrono::year_month_day::month, (3) - std::chrono::year_month_day::year,std::chrono::year_month_day::month,
- std::chrono::year_month_day::year,std::chrono::year_month_day::month,std::chrono::year_month_day::day (3) - std::chrono::year_month_day::year,std::chrono::year_month_day::month,std::chrono::year_month_day::day
- std::chrono::year_month_day::year_month_day (3) - std::chrono::year_month_day::year_month_day
- std::chrono::year_month_day_last (3) - std::chrono::year_month_day_last
- std::chrono::year_month_day_last::ok (3) - std::chrono::year_month_day_last::ok
- std::chrono::year_month_day_last::operator+=,std::chrono::year_month_day_last::operator-= (3) - std::chrono::year_month_day_last::operator+=,std::chrono::year_month_day_last::operator-=
- std::chrono::year_month_day_last::operatorsys_days, (3) - std::chrono::year_month_day_last::operatorsys_days,
- std::chrono::year_month_day_last::operatorsys_days,std::chrono::year_month_day_last::operatorlocal_days (3) - std::chrono::year_month_day_last::operatorsys_days,std::chrono::year_month_day_last::operatorlocal_days
- std::chrono::year_month_day_last::year,std::chrono::year_month_day_last::month, (3) - std::chrono::year_month_day_last::year,std::chrono::year_month_day_last::month,