std::chrono::operator+,std::chrono::operator-(std::chrono::weekday) (3) - Linux Manuals
std::chrono::operator+,std::chrono::operator-(std::chrono::weekday): std::chrono::operator+,std::chrono::operator-(std::chrono::weekday)
Command to display std::chrono::operator+,std::chrono::operator-(std::chrono::weekday)
manual in Linux: $ man 3 std::chrono::operator+,std::chrono::operator-(std::chrono::weekday)
NAME
std::chrono::operator+,std::chrono::operator-(std::chrono::weekday) - std::chrono::operator+,std::chrono::operator-(std::chrono::weekday)
Synopsis
constexpr std::chrono::weekday operator+(const std::chrono::weekday& wd, (1) (since C++20)
const std::chrono::days& d) noexcept;
constexpr std::chrono::weekday operator+(const std::chrono::days& d, (2) (since C++20)
const std::chrono::weekday& wd) noexcept;
constexpr std::chrono::weekday operator-(const std::chrono::weekday& wd, (3) (since C++20)
const std::chrono::days& d) noexcept;
constexpr std::chrono::days operator-(const std::chrono::weekday& wd1, (4) (since C++20)
const std::chrono::weekday& wd2) noexcept;
1-2) Adds d.count() days to wd. The weekday value held in the result is computed by first evaluating static_cast<long long>(unsigned(wd)) + d.count() and reducing it modulo 7 to an integer in the range [0, 6].
3) Subtracts d.count() days from wd. Equivalent to return wd + -d;
4) If wd1.ok() and wd2.ok() are both true, returns a std::chrono::days value d such that d.count() is in the range [0, 6] and wd2 + d == wd1. Otherwise the returned value is unspecified.
Return value
1-3) A std::chrono::weekday holding a weekday value calculated as described above.
4) A std::chrono::days representing the distance between wd1 and wd2.
Notes
As long as the computation doesn't overflow, (1-3) always return a valid weekday even if wd.ok() is false.
Example
This section is incomplete
Reason: no example
See also
operator++ increments or decrements the weekday
operator++(int) (public member function)
operator--
operator--(int)
adds or subtracts a number of days
operator+= (public member function)
operator-=
Pages related to std::chrono::operator+,std::chrono::operator-(std::chrono::weekday)
- std::chrono::operator+,std::chrono::operator-(std::chrono::day) (3) - std::chrono::operator+,std::chrono::operator-(std::chrono::day)
- std::chrono::operator+,std::chrono::operator-(std::chrono::month) (3) - std::chrono::operator+,std::chrono::operator-(std::chrono::month)
- std::chrono::operator+,std::chrono::operator-(std::chrono::year) (3) - std::chrono::operator+,std::chrono::operator-(std::chrono::year)
- std::chrono::operator+,std::chrono::operator-(std::chrono::year_month) (3) - std::chrono::operator+,std::chrono::operator-(std::chrono::year_month)
- std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_day) (3) - std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_day)
- std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_day_last) (3) - std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_day_last)
- std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_weekday) (3) - std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_weekday)
- std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_weekday_last) (3) - std::chrono::operator+,std::chrono::operator-(std::chrono::year_month_weekday_last)
- std::chrono::operator<<(std::chrono::day) (3) - std::chrono::operator<<(std::chrono::day)
- std::chrono::operator<<(std::chrono::duration) (3) - std::chrono::operator<<(std::chrono::duration)
- std::chrono::operator<<(std::chrono::file_time) (3) - std::chrono::operator<<(std::chrono::file_time)
- std::chrono::operator<<(std::chrono::gps_time) (3) - std::chrono::operator<<(std::chrono::gps_time)
- std::chrono::operator<<(std::chrono::local_info) (3) - std::chrono::operator<<(std::chrono::local_info)
- std::chrono::operator<<(std::chrono::local_time) (3) - std::chrono::operator<<(std::chrono::local_time)
- std::chrono::operator<<(std::chrono::month) (3) - std::chrono::operator<<(std::chrono::month)
- std::chrono::operator<<(std::chrono::month_day) (3) - std::chrono::operator<<(std::chrono::month_day)
- std::chrono::operator<<(std::chrono::month_day_last) (3) - std::chrono::operator<<(std::chrono::month_day_last)
- std::chrono::operator<<(std::chrono::month_weekday) (3) - std::chrono::operator<<(std::chrono::month_weekday)
- std::chrono::operator<<(std::chrono::month_weekday_last) (3) - std::chrono::operator<<(std::chrono::month_weekday_last)
- std::chrono::operator<<(std::chrono::sys_info) (3) - std::chrono::operator<<(std::chrono::sys_info)
- std::chrono::operator<<(std::chrono::sys_time) (3) - std::chrono::operator<<(std::chrono::sys_time)
- std::chrono::operator<<(std::chrono::tai_time) (3) - std::chrono::operator<<(std::chrono::tai_time)
- std::chrono::operator<<(std::chrono::time_of_day) (3) - std::chrono::operator<<(std::chrono::time_of_day)
- std::chrono::operator<<(std::chrono::utc_time) (3) - std::chrono::operator<<(std::chrono::utc_time)
- std::chrono::operator<<(std::chrono::weekday) (3) - std::chrono::operator<<(std::chrono::weekday)