year_month
| ||
constexpr auto operator/(const std::chrono::year& y, const std::chrono::month& m) noexcept -> std::chrono::year_month; | (1) | (since C++20) |
constexpr auto operator/(const std::chrono::year& y, int m) noexcept -> std::chrono::year_month; | (2) | (since C++20) |
month_day
| ||
constexpr auto operator/(const std::chrono::month& m, const std::chrono::day& d) noexcept -> std::chrono::month_day; | (3) | (since C++20) |
constexpr auto operator/(const std::chrono::month& m, int d) noexcept -> std::chrono::month_day; | (4) | (since C++20) |
constexpr auto operator/(int m, const std::chrono::day& d) noexcept -> std::chrono::month_day; | (5) | (since C++20) |
constexpr auto operator/(const std::chrono::day& d, const std::chrono::month& m) noexcept -> std::chrono::month_day; | (6) | (since C++20) |
constexpr auto operator/(const std::chrono::day& d, int m) noexcept -> std::chrono::month_day; | (7) | (since C++20) |
month_day_last
| ||
constexpr auto operator/(const std::chrono::month& m, std::chrono::last_spec) noexcept -> std::chrono::month_day_last; | (8) | (since C++20) |
constexpr auto operator/(int m, std::chrono::last_spec) noexcept -> std::chrono::month_day_last; | (9) | (since C++20) |
constexpr auto operator/(std::chrono::last_spec, const std::chrono::month& m) noexcept -> std::chrono::month_day_last; | (10) | (since C++20) |
constexpr auto operator/(std::chrono::last_spec, int m) noexcept -> std::chrono::month_day_last; | (11) | (since C++20) |
month_weekday
| ||
constexpr auto operator/(const std::chrono::month& m, const std::chrono::weekday_indexed& wdi) noexcept -> std::chrono::month_weekday; | (12) | (since C++20) |
constexpr auto operator/(int m, const std::chrono::weekday_indexed& wdi) noexcept -> std::chrono::month_weekday; | (13) | (since C++20) |
constexpr auto operator/(const std::chrono::weekday_indexed& wdi, const std::chrono::month& m) noexcept -> std::chrono::month_weekday; | (14) | (since C++20) |
constexpr auto operator/(const std::chrono::weekday_indexed& wdi, int m) noexcept -> std::chrono::month_weekday; | (15) | (since C++20) |
month_weekday_last
| ||
constexpr auto operator/(const std::chrono::month& m, const std::chrono::weekday_last& wdl) noexcept -> std::chrono::month_weekday_last; | (16) | (since C++20) |
constexpr auto operator/(int m, const std::chrono::weekday_last& wdl) noexcept -> std::chrono::month_weekday_last; | (17) | (since C++20) |
constexpr auto operator/(const std::chrono::weekday_last& wdl, const std::chrono::month& m) noexcept -> std::chrono::month_weekday_last; | (18) | (since C++20) |
constexpr auto operator/(const std::chrono::weekday_last& wdl, int m) noexcept -> std::chrono::month_weekday_last; | (19) | (since C++20) |
year_month_day
| ||
constexpr auto operator/(const std::chrono::year_month& ym, const std::chrono::day& d) noexcept -> std::chrono::year_month_day; | (20) | (since C++20) |
constexpr auto operator/(const std::chrono::year_month& ym, int d) noexcept -> std::chrono::year_month_day; | (21) | (since C++20) |
constexpr auto operator/(const std::chrono::year& y, const std::chrono::month_day& md) noexcept -> std::chrono::year_month_day; | (22) | (since C++20) |
constexpr auto operator/(int y, const std::chrono::month_day& md) noexcept -> std::chrono::year_month_day; | (23) | (since C++20) |
constexpr auto operator/(const std::chrono::month_day& md, const std::chrono::year& y) noexcept -> std::chrono::year_month_day; | (24) | (since C++20) |
constexpr auto operator/(const std::chrono::month_day& md, int y) noexcept -> std::chrono::year_month_day; | (25) | (since C++20) |
year_month_day_last
| ||
constexpr auto operator/(const std::chrono::year_month& ym, std::chrono::last_spec) noexcept -> std::chrono::year_month_day_last; | (26) | (since C++20) |
constexpr auto operator/(const std::chrono::year& y, const std::chrono::month_day_last& mdl) noexcept -> std::chrono::year_month_day_last; | (27) | (since C++20) |
constexpr auto operator/(int y, const std::chrono::month_day_last& mdl) noexcept -> std::chrono::year_month_day_last; | (28) | (since C++20) |
constexpr auto operator/(const std::chrono::month_day_last& mdl, const std::chrono::year& y) noexcept -> std::chrono::year_month_day_last; | (29) | (since C++20) |
constexpr auto operator/(const std::chrono::month_day_last& mdl, int y) noexcept -> std::chrono::year_month_day_last; | (30) | (since C++20) |
year_month_weekday
| ||
constexpr auto operator/(const std::chrono::year_month& ym, const std::chrono::weekday_indexed& wdi) noexcept -> std::chrono::year_month_weekday; | (31) | (since C++20) |
constexpr auto operator/(const std::chrono::year& y, const std::chrono::month_weekday& mwd) noexcept -> std::chrono::year_month_weekday; | (32) | (since C++20) |
constexpr auto operator/(int y, const std::chrono::month_weekday& mwd) noexcept -> std::chrono::year_month_weekday; | (33) | (since C++20) |
constexpr auto operator/(const std::chrono::month_weekday& mwd, const std::chrono::year& y) noexcept -> std::chrono::year_month_weekday; | (34) | (since C++20) |
constexpr auto operator/(const std::chrono::month_weekday& mwd, int y) noexcept -> std::chrono::year_month_weekday; | (35) | (since C++20) |
year_month_weekday_last
| ||
constexpr auto operator/(const std::chrono::year_month& ym, const std::chrono::weekday_last& wdl) noexcept -> std::chrono::year_month_weekday_last; | (36) | (since C++20) |
constexpr auto operator/(const std::chrono::year& y, const std::chrono::month_weekday_last& mwdl) noexcept -> std::chrono::year_month_weekday_last; | (37) | (since C++20) |
constexpr auto operator/(int y, const std::chrono::month_weekday_last& mwdl) noexcept -> std::chrono::year_month_weekday_last; | (38) | (since C++20) |
constexpr auto operator/(const std::chrono::month_weekday_last& mwdl, const std::chrono::year& y) noexcept -> std::chrono::year_month_weekday_last; | (39) | (since C++20) |
constexpr auto operator/(const std::chrono::month_weekday_last& mwdl, int y) noexcept -> std::chrono::year_month_weekday_last; | (40) | (since C++20) |
These operator/
overloads provide a conventional syntax for the creation of Gregorian calendar dates.
For creation of a full date, any of the following three orders are accepted:
year/month/day
month/day/year
day/month/year
. In each case day
can replaced with one of:
std::chrono::last
, for the last day of the month; weekday[i]
, for the i-th weekday of the month; weekday[std::chrono::last]
, for the last weekday of the month. A plain integer is accepted if its meaning is unambiguous from the types of other operands: 2005y/4/5
is allowed, but 5/April/2005
is not.
Partial-date types (year_month
, month_day
, etc.) can be created by not applying the second operator/
in any of the three orders.
std::chrono::year_month(y, m)
std::chrono::year_month(y, std::chrono::month(m))
std::chrono::month_day(m, d)
std::chrono::month_day(m, std::chrono::day(d))
std::chrono::month_day(std::chrono::month(m), d)
std::chrono::month_day_last(m)
std::chrono::month_weekday(m, wdi)
std::chrono::month_weekday(std::chrono::month(m), wdi)
std::chrono::month_weekday_last(m, wdl)
std::chrono::month_weekday_last(std::chrono::month(m), wdl)
std::chrono::year_month_day(ym.year(), ym.month(), d)
std::chrono::year_month_day(ym.year(), ym.month(), std::chrono::day(d))
std::chrono::year_month_day(y, md.month(), md.day())
std::chrono::year_month_day(std::chrono::year(y), md.month(), md.day())
std::chrono::year_month_day_last(ym.year(), std::chrono::month_day_last(ym.month()))
std::chrono::year_month_day_last(y, mdl)
std::chrono::year_month_day_last(std::chrono::year(y), mdl)
std::chrono::year_month_weekday(ym.year(), ym.month(), wdi)
std::chrono::year_month_weekday(y, mwd.month(), mwd.weekday_indexed())
std::chrono::year_month_weekday(std::chrono::year(y), mwd.month(), mwd.weekday_indexed())
std::chrono::year_month_weekday_last(ym.year(), ym.month(), wdl)
std::chrono::year_month_weekday_last(y, mwdl.month(), mwdl.weekday_last())
std::chrono::year_month_weekday_last(std::chrono::year(y), mwdl.month(), mwdl.weekday_last())
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/chrono/operator_slash