130template<class CharT, class Traits>
131std::basic_ostream<CharT, Traits>&
132operator<<(std::basic_ostream<CharT, Traits>& os, const
weekday& wd);
170template<class CharT, class Traits>
171std::basic_ostream<CharT, Traits>&
172operator<<(std::basic_ostream<CharT, Traits>& os, const
year& y);
207template<class CharT, class Traits>
208std::basic_ostream<CharT, Traits>&
209operator<<(std::basic_ostream<CharT, Traits>& os, const
weeknum& wn);
241template<class CharT, class Traits>
242std::basic_ostream<CharT, Traits>&
243operator<<(std::basic_ostream<CharT, Traits>& os, const
year_weeknum& ym);
274template<class CharT, class Traits>
275std::basic_ostream<CharT, Traits>&
276operator<<(std::basic_ostream<CharT, Traits>& os, const
year_lastweek& ym);
302template<class CharT, class Traits>
303std::basic_ostream<CharT, Traits>&
304operator<<(std::basic_ostream<CharT, Traits>& os, const
weeknum_weekday& md);
327template<class CharT, class Traits>
328std::basic_ostream<CharT, Traits>&
329operator<<(std::basic_ostream<CharT, Traits>& os, const
lastweek_weekday& md);
365template<class CharT, class Traits>
366std::basic_ostream<CharT, Traits>&
410template<class CharT, class Traits>
411std::basic_ostream<CharT, Traits>&
425 return z != 0 ? z : (
unsigned char)7;
433 return z != 7 ? z : 0u;
441 return to_iso_encoding(
static_cast<unsigned char>(
static_cast<unsigned>(
442 z >= -4 ? (z+4) % 7 : (z+5) % 7 + 6)));
448 :
wd_(
static_cast<decltype(
wd_)
>(wd))
454 :
wd_(wd.iso_encoding())
511 return static_cast<unsigned>(x) ==
static_cast<unsigned>(y);
527 auto const diff =
static_cast<unsigned>(x) -
static_cast<unsigned>(y);
528 return days{diff <= 6 ? diff : diff + 7};
536 auto const wdu =
static_cast<long long>(
static_cast<unsigned>(x) - 1u) + y.count();
537 auto const wk = (wdu >= 0 ? wdu : wdu-6) / 7;
538 return weekday{
static_cast<unsigned>(wdu - wk * 7) + 1u};
557template<
class CharT,
class Traits>
559std::basic_ostream<CharT, Traits>&
562 switch (
static_cast<unsigned>(wd))
586 os << static_cast<unsigned>(wd) <<
" is not a valid weekday";
610 using std::chrono::seconds;
611 using std::chrono::minutes;
612 using std::chrono::hours;
613 using std::chrono::duration_cast;
614 static_assert(
sizeof(seconds)*CHAR_BIT >= 41,
"seconds may overflow");
615 static_assert(
sizeof(hours)*CHAR_BIT >= 30,
"hours may overflow");
616 return sizeof(minutes)*CHAR_BIT < 34 ?
626 using std::chrono::seconds;
627 using std::chrono::minutes;
628 using std::chrono::hours;
629 using std::chrono::duration_cast;
630 static_assert(
sizeof(seconds)*CHAR_BIT >= 41,
"seconds may overflow");
631 static_assert(
sizeof(hours)*CHAR_BIT >= 30,
"hours may overflow");
632 return sizeof(minutes)*CHAR_BIT < 34 ?
642 return static_cast<int>(x) ==
static_cast<int>(y);
658 return static_cast<int>(x) <
static_cast<int>(y);
690 return years{
static_cast<int>(x) -
static_cast<int>(y)};
698 return year{
static_cast<int>(x) + y.count()};
714 return year{
static_cast<int>(x) - y.count()};
717template<
class CharT,
class Traits>
719std::basic_ostream<CharT, Traits>&
720operator<<(std::basic_ostream<CharT, Traits>& os,
const year& y)
725 os.width(4 + (y < year{0}));
726 os << static_cast<int>(y);
730#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
731inline namespace literals
762#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
771 : wn_(
static_cast<decltype(wn_)
>(wn))
803 return static_cast<unsigned>(x) ==
static_cast<unsigned>(y);
819 return static_cast<unsigned>(x) <
static_cast<unsigned>(y);
851 return weeks{
static_cast<weeks::rep
>(
static_cast<unsigned>(x)) -
852 static_cast<weeks::rep
>(
static_cast<unsigned>(y))};
860 return weeknum{
static_cast<unsigned>(x) +
static_cast<unsigned>(y.count())};
879template<
class CharT,
class Traits>
881std::basic_ostream<CharT, Traits>&
882operator<<(std::basic_ostream<CharT, Traits>& os,
const weeknum& wn)
889 os << static_cast<unsigned>(wn);
906 return y_.
ok() && 1u <=
static_cast<unsigned>(wn_) && wn_ <= (y_/
last).
weeknum();
930 return x.year() == y.year() && x.weeknum() == y.weeknum();
946 return x.year() < y.year() ? true
947 : (x.year() > y.year() ? false
948 : (x.weeknum() < y.weeknum()));
980 return (ym.year() + dy) / ym.weeknum();
999template<
class CharT,
class Traits>
1001std::basic_ostream<CharT, Traits>&
1002operator<<(std::basic_ostream<CharT, Traits>& os,
const year_weeknum& ywn)
1004 return os << ywn.year() <<
'-' << ywn.weeknum();
1023 const auto y =
date::year{
static_cast<int>(y_)};
1026 return iso_week::weeknum(
static_cast<unsigned>(date::trunc<weeks>(s1-s0).count()));
1052 return x.year() == y.year();
1068 return x.year() < y.year();
1119template<
class CharT,
class Traits>
1121std::basic_ostream<CharT, Traits>&
1122operator<<(std::basic_ostream<CharT, Traits>& os,
const year_lastweek& ywn)
1124 return os << ywn.year() <<
"-W last";
1145 return wn_.
ok() &&
wd_.ok();
1153 return x.weeknum() == y.weeknum() && x.weekday() == y.weekday();
1169 return x.weeknum() < y.weeknum() ? true
1170 : (x.weeknum() > y.weeknum() ? false
1171 : (
static_cast<unsigned>(x.weekday()) <
static_cast<unsigned>(y.weekday())));
1198template<
class CharT,
class Traits>
1200std::basic_ostream<CharT, Traits>&
1201operator<<(std::basic_ostream<CharT, Traits>& os,
const weeknum_weekday& md)
1203 return os << md.weeknum() <<
'-' << md.weekday();
1229 return x.weekday() == y.weekday();
1245 return static_cast<unsigned>(x.weekday()) <
static_cast<unsigned>(y.weekday());
1272template<
class CharT,
class Traits>
1274std::basic_ostream<CharT, Traits>&
1275operator<<(std::basic_ostream<CharT, Traits>& os,
const lastweek_weekday& md)
1277 return os <<
"W last-" << md.weekday();
1313 return (y_ /
last).weeknum();
1339 return y_.
ok() &&
wd_.ok();
1347 return x.year() == y.year() && x.weekday() == y.weekday();
1363 return x.year() < y.year() ? true
1364 : (x.year() > y.year() ? false
1365 : (
static_cast<unsigned>(x.weekday()) <
static_cast<unsigned>(y.weekday())));
1394year_lastweek_weekday
1397 return (ywnwd.year() + y) /
last / ywnwd.weekday();
1402year_lastweek_weekday
1410year_lastweek_weekday
1416template<
class CharT,
class Traits>
1418std::basic_ostream<CharT, Traits>&
1419operator<<(std::basic_ostream<CharT, Traits>& os,
const year_lastweek_weekday& ywnwd)
1421 return os << ywnwd.year() <<
"-W last-" << ywnwd.weekday();
1440 , wn_(ylwwd.weeknum())
1441 ,
wd_(ylwwd.weekday())
1515 static_cast<unsigned>(date::trunc<weeks>(dp - start).count() + 1));
1524 return x.year() == y.year() && x.weeknum() == y.weeknum() && x.weekday() == y.weekday();
1540 return x.year() < y.year() ? true
1541 : (x.year() > y.year() ? false
1542 : (x.weeknum() < y.weeknum() ? true
1543 : (x.weeknum() > y.weeknum() ? false
1544 : (
static_cast<unsigned>(x.weekday()) <
static_cast<unsigned>(y.weekday())))));
1576 return (ywnwd.year() + y) / ywnwd.weeknum() / ywnwd.weekday();
1595template<
class CharT,
class Traits>
1597std::basic_ostream<CharT, Traits>&
1598operator<<(std::basic_ostream<CharT, Traits>& os,
const year_weeknum_weekday& ywnwd)
1600 return os << ywnwd.year() <<
'-' << ywnwd.weeknum() <<
'-' << ywnwd.weekday();
1618 return y/
weeknum(
static_cast<unsigned>(wn));
1642 return wn/
weekday{
static_cast<unsigned>(wd)};
1658 return weeknum{
static_cast<unsigned>(wn)}/wd;
1674 return wn /
weekday{
static_cast<unsigned>(wd)};
1690 return {ywn.year(), ywn.weeknum(), wd};
1698 return ywn /
weekday(
static_cast<unsigned>(wd));
1706 return {y, wnwd.weeknum(), wnwd.weekday()};
1714 return wnwd /
year{y};
1719year_lastweek_weekday
1722 return {ylw.year(), wd};
1727year_lastweek_weekday
1730 return ylw /
weekday(
static_cast<unsigned>(wd));
1735year_lastweek_weekday
1738 return {y, lwwd.weekday()};
1743year_lastweek_weekday
1746 return lwwd /
year{y};
CONSTCD11 date::year year() const NOEXCEPT
CONSTCD11 lastweek_weekday(const iso_week::weekday &wd) NOEXCEPT
CONSTCD14 bool ok() const NOEXCEPT
CONSTCD11 iso_week::weekday weekday() const NOEXCEPT
static CONSTCD11 unsigned char weekday_from_days(int z) NOEXCEPT
weekday & operator-=(const days &d) NOEXCEPT
weekday & operator++() NOEXCEPT
weekday & operator--() NOEXCEPT
CONSTCD11 bool ok() const NOEXCEPT
weekday & operator+=(const days &d) NOEXCEPT
static CONSTCD11 unsigned char to_iso_encoding(unsigned char) NOEXCEPT
CONSTCD11 weekday(unsigned wd) NOEXCEPT
static CONSTCD11 unsigned from_iso_encoding(unsigned) NOEXCEPT
CONSTCD11 iso_week::weeknum weeknum() const NOEXCEPT
CONSTCD14 bool ok() const NOEXCEPT
CONSTCD11 weeknum_weekday(const iso_week::weeknum &wn, const iso_week::weekday &wd) NOEXCEPT
CONSTCD11 iso_week::weekday weekday() const NOEXCEPT
weeknum & operator--() NOEXCEPT
weeknum & operator++() NOEXCEPT
weeknum & operator+=(const weeks &y) NOEXCEPT
CONSTCD11 weeknum(unsigned wn) NOEXCEPT
weeknum & operator-=(const weeks &y) NOEXCEPT
CONSTCD11 bool ok() const NOEXCEPT
CONSTCD11 iso_week::weekday weekday() const NOEXCEPT
CONSTCD11 bool ok() const NOEXCEPT
year_lastweek_weekday & operator-=(const years &y) NOEXCEPT
CONSTCD11 iso_week::year year() const NOEXCEPT
CONSTCD11 year_lastweek_weekday(const iso_week::year &y, const iso_week::weekday &wd) NOEXCEPT
year_lastweek_weekday & operator+=(const years &y) NOEXCEPT
CONSTCD14 iso_week::weeknum weeknum() const NOEXCEPT
CONSTCD14 iso_week::weeknum weeknum() const NOEXCEPT
year_lastweek & operator+=(const years &dy) NOEXCEPT
CONSTCD11 iso_week::year year() const NOEXCEPT
CONSTCD11 year_lastweek(const iso_week::year &y) NOEXCEPT
year_lastweek & operator-=(const years &dy) NOEXCEPT
CONSTCD11 bool ok() const NOEXCEPT
year_weeknum_weekday & operator-=(const years &y) NOEXCEPT
CONSTCD11 year_weeknum_weekday(const iso_week::year &y, const iso_week::weeknum &wn, const iso_week::weekday &wd) NOEXCEPT
CONSTCD14 bool ok() const NOEXCEPT
static CONSTCD14 year_weeknum_weekday from_days(days dp) NOEXCEPT
CONSTCD11 iso_week::weekday weekday() const NOEXCEPT
year_weeknum_weekday & operator+=(const years &y) NOEXCEPT
CONSTCD11 iso_week::year year() const NOEXCEPT
CONSTCD11 iso_week::weeknum weeknum() const NOEXCEPT
CONSTCD11 bool ok() const NOEXCEPT
year_weeknum & operator+=(const years &dy) NOEXCEPT
CONSTCD11 iso_week::weeknum weeknum() const NOEXCEPT
CONSTCD11 year_weeknum(const iso_week::year &y, const iso_week::weeknum &wn) NOEXCEPT
CONSTCD11 iso_week::year year() const NOEXCEPT
year_weeknum & operator-=(const years &dy) NOEXCEPT
CONSTCD11 bool ok() const NOEXCEPT
CONSTCD11 year(int y) NOEXCEPT
year & operator++() NOEXCEPT
year & operator-=(const years &y) NOEXCEPT
year & operator--() NOEXCEPT
static CONSTCD11 year max() NOEXCEPT
year & operator+=(const years &y) NOEXCEPT
static CONSTCD11 year min() NOEXCEPT
CONSTDATA date::weekday mon
CONSTDATA date::last_spec last
CONSTDATA date::month dec
CONSTDATA date::weekday thu
std::chrono::duration< int, detail::ratio_multiply< std::ratio< 146097, 400 >, days::period > > years
local_time< days > local_days
std::chrono::duration< int, detail::ratio_multiply< std::ratio< 7 >, days::period > > weeks
std::chrono::duration< int, detail::ratio_multiply< std::ratio< 24 >, std::chrono::hours::period > > days
sys_time< days > sys_days
CONSTDATA iso_week::weekday wed
CONSTDATA iso_week::last_week last
CONSTDATA iso_week::weekday tue
CONSTDATA iso_week::weekday fri
CONSTDATA iso_week::weekday sun
CONSTDATA iso_week::weekday sat
CONSTDATA iso_week::weekday thu
CONSTDATA iso_week::weekday mon
CONSTCD11 bool operator<(const year &x, const year &y) NOEXCEPT
CONSTCD11 bool operator>=(const year &x, const year &y) NOEXCEPT
CONSTCD11 year_weeknum operator/(const year &y, const weeknum &wn) NOEXCEPT
CONSTCD14 weekday operator-(const weekday &x, const days &y) NOEXCEPT
CONSTCD11 bool operator>(const year &x, const year &y) NOEXCEPT
CONSTCD11 bool operator!=(const weekday &x, const weekday &y) NOEXCEPT
CONSTCD11 bool operator==(const weekday &x, const weekday &y) NOEXCEPT
std::basic_ostream< CharT, Traits > & operator<<(std::basic_ostream< CharT, Traits > &os, const weekday &wd)
CONSTCD11 bool operator<=(const year &x, const year &y) NOEXCEPT
CONSTCD14 weekday operator+(const weekday &x, const days &y) NOEXCEPT
date::local_days local_days