std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_day_last) (3) - Linux Man Pages

std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_day_last): std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_day_last)

NAME

std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_day_last) - std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_day_last)

Synopsis


Defined in header <chrono>
constexpr std::chrono::year_month_day_last (since C++20)
operator+(const std::chrono::year_month_day_last& ymdl, const std::chrono::months& dm) noexcept;
constexpr std::chrono::year_month_day_last (since C++20)
operator+(const std::chrono::months& dm, const std::chrono::year_month_day_last& ymdl) noexcept;
constexpr std::chrono::year_month_day_last (since C++20)
operator+(const std::chrono::year_month_day_last& ymdl, const std::chrono::years& dy) noexcept;
constexpr std::chrono::year_month_day_last (since C++20)
operator+(const std::chrono::years& dy, const std::chrono::year_month_day_last& ymdl) noexcept;
constexpr std::chrono::year_month_day_last (since C++20)
operator-(const std::chrono::year_month_day_last& ymdl, const std::chrono::months& dm) noexcept;
constexpr std::chrono::year_month_day_last (since C++20)
operator-(const std::chrono::year_month_day_last& ymdl, const std::chrono::years& dy) noexcept;


1-2) Adds dm.count() months to the date represented by ymdl. The result has the same year() and month() as std::chrono::year_month(ymdl.year(), ymdl.month()) + dm.
3-4) Adds dy.count() years to the date represented by ymdl. The result is equivalent to std::chrono::year_month_day_last(ymdl.year() + dy, ymdl.month_day_last()).
5) Subtracts dm.count() months from the date represented by ymdl. Equivalent to ymdl + -dm.
6) Subtracts dy.count() years from the date represented by ymdl. Equivalent to ymdl + -dy.