34 #ifndef HAS_STRING_VIEW 35 # if __cplusplus >= 201703 || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) 36 # define HAS_STRING_VIEW 1 38 # define HAS_STRING_VIEW 0 40 #endif // HAS_STRING_VIEW 47 #if !(__cplusplus >= 201402) 66 # include <string_view> 69 #include <type_traits> 72 # pragma GCC diagnostic push 73 # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR > 7) 74 # pragma GCC diagnostic ignored "-Wpedantic" 78 # pragma GCC diagnostic ignored "-Wmissing-field-initializers" 83 # pragma warning(push) 85 # pragma warning(disable : 4127) 95 # define ONLY_C_LOCALE 0 98 #if defined(_MSC_VER) && (!defined(__clang__) || (_MSC_VER < 1910)) 100 # ifndef _SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING 101 # define _SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING 105 # define CONSTDATA const 108 # define NOEXCEPT _NOEXCEPT 111 # define CONSTDATA constexpr const 112 # define CONSTCD11 constexpr 113 # define CONSTCD14 constexpr 114 # define NOEXCEPT noexcept 117 #elif defined(__SUNPRO_CC) && __SUNPRO_CC <= 0x5150 119 # define CONSTDATA constexpr const 120 # define CONSTCD11 constexpr 122 # define NOEXCEPT noexcept 124 #elif __cplusplus >= 201402 126 # define CONSTDATA constexpr const 127 # define CONSTCD11 constexpr 128 # define CONSTCD14 constexpr 129 # define NOEXCEPT noexcept 132 # define CONSTDATA constexpr const 133 # define CONSTCD11 constexpr 135 # define NOEXCEPT noexcept 138 #ifndef HAS_UNCAUGHT_EXCEPTIONS 139 # if __cplusplus > 201703 140 # define HAS_UNCAUGHT_EXCEPTIONS 1 142 # define HAS_UNCAUGHT_EXCEPTIONS 0 144 #endif // HAS_UNCAUGHT_EXCEPTIONS 147 # if __cplusplus >= 201703 148 # define HAS_VOID_T 1 150 # define HAS_VOID_T 0 165 using days = std::chrono::duration
166 <int, std::ratio_multiply<std::ratio<24>, std::chrono::hours::period>::type>;
168 using weeks = std::chrono::duration
169 <int, std::ratio_multiply<std::ratio<7>, days::period>::type>;
171 using years = std::chrono::duration
172 <int, std::ratio_multiply<std::ratio<146097, 400>, days::period>::type>;
174 using months = std::chrono::duration
175 <int, std::ratio_divide<years::period, std::ratio<12>>::type>;
179 template <
class Duration>
180 using sys_time = std::chrono::time_point<std::chrono::system_clock, Duration>;
187 template <
class Duration>
188 using local_time = std::chrono::time_point<local_t, Duration>;
350 template<
class CharT,
class Traits>
351 std::basic_ostream<CharT, Traits> &
352 operator<<(std::basic_ostream<CharT, Traits> &os,
const day &d);
387 template<
class CharT,
class Traits>
388 std::basic_ostream<CharT, Traits> &
389 operator<<(std::basic_ostream<CharT, Traits> &os,
const month &m);
432 template<
class CharT,
class Traits>
433 std::basic_ostream<CharT, Traits> &
434 operator<<(std::basic_ostream<CharT, Traits> &os,
const year &y);
468 template<
class CharT,
class Traits>
469 friend std::basic_ostream<CharT, Traits> &
470 operator<<(std::basic_ostream<CharT, Traits> &os,
const weekday &wd);
482 template<
class CharT,
class Traits>
483 std::basic_ostream<CharT, Traits> &
484 operator<<(std::basic_ostream<CharT, Traits> &os,
const weekday &wd);
489 unsigned char wd_ : 4;
490 unsigned char index_ : 4;
506 template<
class CharT,
class Traits>
507 std::basic_ostream<CharT, Traits> &
508 operator<<(std::basic_ostream<CharT, Traits> &os,
const weekday_indexed &wdi);
527 template<
class CharT,
class Traits>
528 std::basic_ostream<CharT, Traits> &
529 operator<<(std::basic_ostream<CharT, Traits> &os,
const weekday_last &wdl);
550 template<
class = detail::unspecified_month_disambiguator>
552 template<
class = detail::unspecified_month_disambiguator>
567 template<
class = detail::unspecified_month_disambiguator>
569 template<
class = detail::unspecified_month_disambiguator>
571 template<
class = detail::unspecified_month_disambiguator>
579 template<
class CharT,
class Traits>
580 std::basic_ostream<CharT, Traits> &
581 operator<<(std::basic_ostream<CharT, Traits> &os,
const year_month &ym);
606 template<
class CharT,
class Traits>
607 std::basic_ostream<CharT, Traits> &
608 operator<<(std::basic_ostream<CharT, Traits> &os,
const month_day &md);
635 template<
class CharT,
class Traits>
636 std::basic_ostream<CharT, Traits> &
637 operator<<(std::basic_ostream<CharT, Traits> &os,
const month_day_last &mdl);
659 template<
class CharT,
class Traits>
660 std::basic_ostream<CharT, Traits> &
661 operator<<(std::basic_ostream<CharT, Traits> &os,
const month_weekday &mwd);
686 template<
class CharT,
class Traits>
687 std::basic_ostream<CharT, Traits> &
688 operator<<(std::basic_ostream<CharT, Traits> &os,
707 template<
class = detail::unspecified_month_disambiguator>
709 template<
class = detail::unspecified_month_disambiguator>
740 template<
class = detail::unspecified_month_disambiguator>
743 template<
class = detail::unspecified_month_disambiguator>
746 template<
class = detail::unspecified_month_disambiguator>
756 template<
class CharT,
class Traits>
757 std::basic_ostream<CharT, Traits> &
758 operator<<(std::basic_ostream<CharT, Traits> &os,
const year_month_day &ymd);
770 template<
class = detail::unspecified_month_disambiguator>
772 template<
class = detail::unspecified_month_disambiguator>
806 template<
class = detail::unspecified_month_disambiguator>
811 template<
class = detail::unspecified_month_disambiguator>
824 template<
class = detail::unspecified_month_disambiguator>
833 template<
class CharT,
class Traits>
834 std::basic_ostream<CharT, Traits> &
835 operator<<(std::basic_ostream<CharT, Traits> &os,
852 template<
class = detail::unspecified_month_disambiguator>
854 template<
class = detail::unspecified_month_disambiguator>
881 template<
class = detail::unspecified_month_disambiguator>
886 template<
class = detail::unspecified_month_disambiguator>
899 template<
class = detail::unspecified_month_disambiguator>
908 template<
class CharT,
class Traits>
909 std::basic_ostream<CharT, Traits> &
910 operator<<(std::basic_ostream<CharT, Traits> &os,
924 template<
class = detail::unspecified_month_disambiguator>
926 template<
class = detail::unspecified_month_disambiguator>
954 template<
class = detail::unspecified_month_disambiguator>
959 template<
class = detail::unspecified_month_disambiguator>
972 template<
class = detail::unspecified_month_disambiguator>
981 template<
class CharT,
class Traits>
982 std::basic_ostream<CharT, Traits> &
983 operator<<(std::basic_ostream<CharT, Traits> &os,
986 #if !defined(_MSC_VER) || (_MSC_VER >= 1900) 987 inline namespace literals {
993 #endif // !defined(_MSC_VER) || (_MSC_VER >= 1900) 1018 template <
class T,
class = std::
void_t<>>
1024 struct is_clock<T, std::void_t<decltype(T::now()), typename T::rep, typename T::period,
1025 typename T::duration, typename T::time_point,
1026 decltype(T::is_steady)>>
1030 #endif // HAS_VOID_T 1039 template<
class CharT,
class Traits = std::
char_traits<CharT>>
1042 std::basic_ios<CharT, Traits> &
is_;
1046 std::basic_ostream<CharT, Traits> *
tie_;
1065 , flags_(is.flags())
1066 , width_(is.
width(0))
1067 , tie_(is.tie(nullptr))
1070 if (tie_ !=
nullptr) {
1076 template<
class CharT,
class Traits = std::
char_traits<CharT>>
1082 if ((this->flags_ & std::ios::unitbuf) &&
1084 std::uncaught_exceptions() == 0 &&
1086 !std::uncaught_exception() &&
1089 this->is_.rdbuf()->pubsync();
1104 static const int digits = std::numeric_limits<T>::digits;
1105 using type =
typename std::conditional
1109 typename std::conditional
1113 #ifdef __SIZEOF_INT128__ 1125 typename std::enable_if
1127 !std::chrono::treat_as_floating_point<T>::value,
1137 typename std::enable_if
1139 std::chrono::treat_as_floating_point<T>::value,
1143 using std::numeric_limits;
1145 CONSTDATA auto digits = numeric_limits<T>::digits;
1146 static_assert(digits < numeric_limits<I>::digits,
"");
1147 CONSTDATA auto max = I{1} << (digits - 1);
1149 const auto negative =
t < T{0};
1150 if (min <=
t &&
t <= max &&
t != 0 &&
t ==
t)
1152 t =
static_cast<T
>(
static_cast<I
>(
t));
1153 if (
t == 0 && negative) {
1160 template <std::
intmax_t Xp, std::
intmax_t Yp>
1165 template <std::
intmax_t Xp>
1167 static const std::intmax_t value = Xp;
1172 static const std::intmax_t value = 1;
1175 template <
class R1,
class R2>
1180 static const std::intmax_t n1 = R1::num / gcd_n1_n2;
1181 static const std::intmax_t d1 =
R1::den / gcd_d1_d2;
1182 static const std::intmax_t n2 = R2::num / gcd_n1_n2;
1183 static const std::intmax_t d2 =
R2::den / gcd_d1_d2;
1184 static const std::intmax_t max = INTMAX_MAX;
1186 template <std::
intmax_t Xp, std::
intmax_t Yp,
bool overflow>
1188 static const std::intmax_t value = Xp * Yp;
1191 template <std::
intmax_t Xp, std::
intmax_t Yp>
1192 struct mul<Xp, Yp, true> {
1193 static const std::intmax_t value = 1;
1197 static const bool value = (n1 <= max / d2) && (n2 <= max / d1);
1198 typedef std::ratio < mul < n1, d2, !value >::value,
1199 mul < n2, d1, !value >::value >
type;
1205 template <
class To,
class Rep,
class Period>
1208 typename std::enable_if
1213 trunc(
const std::chrono::duration<Rep, Period> &d)
1218 template <
class To,
class Rep,
class Period>
1221 typename std::enable_if
1223 !detail::no_overflow<Period, typename To::period>::value,
1226 trunc(
const std::chrono::duration<Rep, Period> &d)
1228 using std::chrono::duration_cast;
1229 using std::chrono::duration;
1230 using rep =
typename std::common_type<Rep, typename To::rep>::type;
1231 return To{
detail::trunc(duration_cast<To>(duration_cast<duration<rep>>(d)).
count())};
1234 #ifndef HAS_CHRONO_ROUNDING 1235 # if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 190023918 || (_MSC_FULL_VER >= 190000000 && defined (__clang__))) 1236 # define HAS_CHRONO_ROUNDING 1 1237 # elif defined(__cpp_lib_chrono) && __cplusplus > 201402 && __cpp_lib_chrono >= 201510 1238 # define HAS_CHRONO_ROUNDING 1 1239 # elif defined(_LIBCPP_VERSION) && __cplusplus > 201402 && _LIBCPP_VERSION >= 3800 1240 # define HAS_CHRONO_ROUNDING 1 1242 # define HAS_CHRONO_ROUNDING 0 1244 #endif // HAS_CHRONO_ROUNDING 1246 #if HAS_CHRONO_ROUNDING == 0 1249 template <
class To,
class Rep,
class Period>
1252 typename std::enable_if
1254 detail::no_overflow<Period, typename To::period>::value,
1257 floor(
const std::chrono::duration<Rep, Period> &d)
1259 auto t = trunc<To>(d);
1265 template <
class To,
class Rep,
class Period>
1268 typename std::enable_if
1270 !detail::no_overflow<Period, typename To::period>::value,
1273 floor(
const std::chrono::duration<Rep, Period> &d)
1275 using rep =
typename std::common_type<Rep, typename To::rep>::type;
1276 return floor<To>(floor<std::chrono::duration<rep>>(d));
1280 template <
class To,
class Rep,
class Period>
1284 round(
const std::chrono::duration<Rep, Period> &d)
1286 auto t0 = floor<To>(d);
1287 auto t1 = t0 + To{1};
1288 if (t1 == To{0} && t0 < To{0})
1290 auto diff0 = d - t0;
1291 auto diff1 = t1 - d;
1292 if (diff0 == diff1) {
1293 if (t0 - trunc<To>(t0 / 2) * 2 == To{0})
1297 if (diff0 < diff1) {
1304 template <
class To,
class Rep,
class Period>
1308 ceil(
const std::chrono::duration<Rep, Period> &d)
1310 auto t = trunc<To>(d);
1316 template <
class Rep,
class Period,
1317 class =
typename std::enable_if
1319 std::numeric_limits<Rep>::is_signed
1322 std::chrono::duration<Rep, Period>
1323 abs(std::chrono::duration<Rep, Period> d)
1325 return d >= d.zero() ? d : -d;
1329 template <
class To,
class Clock,
class FromDuration>
1332 std::chrono::time_point<Clock, To>
1333 floor(
const std::chrono::time_point<Clock, FromDuration> &tp)
1335 using std::chrono::time_point;
1336 return time_point<Clock, To> {date::floor<To>(tp.time_since_epoch())};
1340 template <
class To,
class Clock,
class FromDuration>
1343 std::chrono::time_point<Clock, To>
1344 round(
const std::chrono::time_point<Clock, FromDuration> &tp)
1346 using std::chrono::time_point;
1347 return time_point<Clock, To> {round<To>(tp.time_since_epoch())};
1351 template <
class To,
class Clock,
class FromDuration>
1354 std::chrono::time_point<Clock, To>
1355 ceil(
const std::chrono::time_point<Clock, FromDuration> &tp)
1357 using std::chrono::time_point;
1358 return time_point<Clock, To> {ceil<To>(tp.time_since_epoch())};
1361 #else // HAS_CHRONO_ROUNDING == 1 1368 #endif // HAS_CHRONO_ROUNDING 1371 template <
class To,
class Clock,
class FromDuration>
1374 std::chrono::time_point<Clock, To>
1375 trunc(
const std::chrono::time_point<Clock, FromDuration> &tp)
1377 using std::chrono::time_point;
1378 return time_point<Clock, To> {trunc<To>(tp.time_since_epoch())};
1384 d_(static_cast<unsigned char>(d)) {}
1397 return 1 <= d_ && d_ <= 31;
1404 return static_cast<unsigned>(x) == static_cast<unsigned>(y);
1418 return static_cast<unsigned>(x) < static_cast<unsigned>(y);
1447 static_cast<days::rep
>(
static_cast<unsigned>(x)
1448 - static_cast<unsigned>(y))};
1455 return day{
static_cast<unsigned>(x) + static_cast<unsigned>(y.count())};
1472 template<
class CharT,
class Traits>
1474 std::basic_ostream<CharT, Traits> &
1475 operator<<(std::basic_ostream<CharT, Traits> &os,
const day &d)
1481 os << static_cast<unsigned>(d);
1483 os <<
" is not a valid day";
1491 m_(
static_cast<decltype(m_)
>(m)) {}
1519 return 1 <= m_ && m_ <= 12;
1526 return static_cast<unsigned>(x) == static_cast<unsigned>(y);
1540 return static_cast<unsigned>(x) < static_cast<unsigned>(y);
1568 auto const d =
static_cast<unsigned>(x) - static_cast<unsigned>(y);
1569 return months(d <= 11 ? d : d + 12);
1576 auto const mu =
static_cast<long long>(
static_cast<unsigned>(x)) + (y.count() - 1);
1577 auto const yr = (mu >= 0 ? mu : mu - 11) / 12;
1578 return month{
static_cast<unsigned>(mu - yr * 12 + 1)};
1595 template<
class CharT,
class Traits>
1597 std::basic_ostream<CharT, Traits> &
1598 operator<<(std::basic_ostream<CharT, Traits> &os,
const month &m)
1601 CharT fmt[] = {
'%',
'b', 0};
1602 os <<
format(os.getloc(), fmt, m);
1605 os << static_cast<unsigned>(m) <<
" is not a valid month";
1613 y_(
static_cast<decltype(y_)
>(y)) {}
1634 return y_ % 4 == 0 && (y_ % 100 != 0 || y_ % 400 == 0);
1647 return y_ != std::numeric_limits<short>::min();
1654 return static_cast<int>(x) == static_cast<int>(y);
1668 return static_cast<int>(x) < static_cast<int>(y);
1696 return years{
static_cast<int>(x) - static_cast<int>(y)};
1703 return year{
static_cast<int>(x) + y.count()};
1717 return year{
static_cast<int>(x) - y.count()};
1720 template<
class CharT,
class Traits>
1722 std::basic_ostream<CharT, Traits> &
1723 operator<<(std::basic_ostream<CharT, Traits> &os,
const year &y)
1728 os.width(4 + (y <
year{0}));
1729 os.imbue(std::locale::classic());
1730 os << static_cast<int>(y);
1732 os <<
" is not a valid year";
1742 weekday::weekday_from_days(
int z) NOEXCEPT {
1743 auto u =
static_cast<unsigned>(z);
1744 return static_cast<unsigned char>(z >= -4 ? (
u + 4) % 7 :
u % 7);
1751 wd_(
static_cast<decltype(wd_)
>(wd != 7 ? wd : 0))
1758 wd_(weekday_from_days(dp.time_since_epoch().count()))
1765 wd_(weekday_from_days(dp.time_since_epoch().count()))
1798 return unsigned{wd_};
1805 return unsigned{((wd_ == 0
u) ? 7
u : wd_)};
1812 return x.wd_ == y.wd_;
1826 auto const wdu = x.wd_ - y.wd_;
1827 auto const wk = (wdu >= 0 ? wdu : wdu - 6) / 7;
1828 return days{wdu - wk * 7};
1835 auto const wdu =
static_cast<long long>(
static_cast<unsigned>(x.wd_)) + y.count();
1836 auto const wk = (wdu >= 0 ? wdu : wdu - 6) / 7;
1837 return weekday{
static_cast<unsigned>(wdu - wk * 7)};
1854 template<
class CharT,
class Traits>
1856 std::basic_ostream<CharT, Traits> &
1857 operator<<(std::basic_ostream<CharT, Traits> &os,
const weekday &wd)
1860 CharT fmt[] = {
'%',
'a', 0};
1864 os << static_cast<unsigned>(wd.wd_) <<
" is not a valid weekday";
1869 #if !defined(_MSC_VER) || (_MSC_VER >= 1900) 1870 inline namespace literals {
1875 operator "" _d(
unsigned long long d) NOEXCEPT {
1876 return date::day{
static_cast<unsigned>(d)};
1882 operator "" _y(
unsigned long long y) NOEXCEPT {
1885 #endif // !defined(_MSC_VER) || (_MSC_VER >= 1900) 1910 #if !defined(_MSC_VER) || (_MSC_VER >= 1900) 1955 return weekday().
ok() && 1 <= index_ && index_ <= 5;
1959 # pragma GCC diagnostic push 1960 # pragma GCC diagnostic ignored "-Wconversion" 1968 wd_(
static_cast<decltype(wd_)
>(static_cast<unsigned>(wd.wd_)))
1969 , index_(
static_cast<decltype(index_)
>(index))
1973 # pragma GCC diagnostic pop 1976 template<
class CharT,
class Traits>
1978 std::basic_ostream<CharT, Traits> &
1982 if (!(1 <= wdi.
index() && wdi.
index() <= 5)) {
1983 os <<
" is not a valid index";
1994 return {*
this, index};
2038 template<
class CharT,
class Traits>
2040 std::basic_ostream<CharT, Traits> &
2043 return os << wdl.
weekday() <<
"[last]";
2074 return y_.ok() && m_.ok();
2160 auto dmi =
static_cast<int>(
static_cast<unsigned>(ym.
month())) - 1 + dm.count();
2161 auto dy = (dmi >= 0 ? dmi : dmi - 11) / 12;
2162 dmi = dmi - dy * 12 + 1;
2163 return (ym.
year() +
years(dy)) /
month(static_cast<unsigned>(dmi));
2187 months(static_cast<unsigned>(x.
month()) - static_cast<unsigned>(y.
month()));
2211 template<
class CharT,
class Traits>
2213 std::basic_ostream<CharT, Traits> &
2214 operator<<(std::basic_ostream<CharT, Traits> &os,
const year_month &ym)
2216 return os << ym.
year() <<
'/' << ym.
month();
2249 return m_.
ok() &&
date::day{1} <= d_ &&d_ <= d[static_cast<unsigned>(m_) - 1];
2256 return x.
month() == y.
month() && x.day() == y.day();
2272 : (x.day() < y.day()));
2296 template<
class CharT,
class Traits>
2298 std::basic_ostream<CharT, Traits> &
2299 operator<<(std::basic_ostream<CharT, Traits> &os,
const month_day &md)
2301 return os << md.
month() <<
'/' << md.
day();
2359 template<
class CharT,
class Traits>
2361 std::basic_ostream<CharT, Traits> &
2364 return os << mdl.
month() <<
"/last";
2396 return m_.ok() && wdi_.ok();
2403 return x.
month() == y.
month() && x.weekday_indexed() == y.weekday_indexed();
2413 template<
class CharT,
class Traits>
2415 std::basic_ostream<CharT, Traits> &
2450 return m_.ok() && wdl_.ok();
2467 template<
class CharT,
class Traits>
2469 std::basic_ostream<CharT, Traits> &
2470 operator<<(std::basic_ostream<CharT, Traits> &os,
2527 return mdl_.
month();
2555 year_month_day_last::operator
sys_days() const NOEXCEPT
2572 return y_.ok() && mdl_.ok();
2580 return x.
year() == y.
year() && x.month_day_last() == y.month_day_last();
2597 : (x.month_day_last() < y.month_day_last()));
2623 template<
class CharT,
class Traits>
2625 std::basic_ostream<CharT, Traits> &
2626 operator<<(std::basic_ostream<CharT, Traits> &os,
2653 return ymdl + (-dm);
2674 return ymdl + (-dy);
2762 year_month_day::to_days()
const NOEXCEPT
2764 static_assert(std::numeric_limits<unsigned>::digits >= 18,
2765 "This algorithm has not been ported to a 16 bit unsigned integer");
2766 static_assert(std::numeric_limits<int>::digits >= 20,
2767 "This algorithm has not been ported to a 16 bit signed integer");
2768 auto const y =
static_cast<int>(y_) - (m_ <=
February);
2769 auto const m =
static_cast<unsigned>(m_);
2770 auto const d =
static_cast<unsigned>(d_);
2771 auto const era = (y >= 0 ? y : y - 399) / 400;
2772 auto const yoe =
static_cast<unsigned>(y - era * 400);
2773 auto const doy = (153 * (m > 2 ? m - 3 : m + 9) + 2) / 5 + d - 1;
2774 auto const doe = yoe * 365 + yoe / 4 - yoe / 100 + doy;
2775 return days{era * 146097 +
static_cast<int>(doe) - 719468};
2797 if (!(y_.ok() && m_.ok())) {
2825 : (x.day() < y.day()))));
2849 template<
class CharT,
class Traits>
2851 std::basic_ostream<CharT, Traits> &
2857 os << ymd.
year() <<
'-';
2859 os << static_cast<unsigned>(ymd.
month()) <<
'-';
2862 os <<
" is not a valid date";
2870 year_month_day::from_days(
days dp) NOEXCEPT {
2871 static_assert(std::numeric_limits<unsigned>::digits >= 18,
2872 "This algorithm has not been ported to a 16 bit unsigned integer");
2873 static_assert(std::numeric_limits<int>::digits >= 20,
2874 "This algorithm has not been ported to a 16 bit signed integer");
2875 auto const z = dp.count() + 719468;
2876 auto const era = (z >= 0 ? z : z - 146096) / 146097;
2877 auto const doe =
static_cast<unsigned>(z - era * 146097);
2878 auto const yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365;
2879 auto const y =
static_cast<days::rep
>(yoe) + era * 400;
2880 auto const doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
2881 auto const mp = (5 * doy + 2) / 153;
2882 auto const d = doy - (153 * mp + 2) / 5 + 1;
2883 auto const m = mp < 10 ? mp + 3 : mp - 9;
3016 return wdi_.index();
3046 if (!y_.ok() || !m_.ok() || !wdi_.weekday().ok() || wdi_.index() < 1) {
3049 if (wdi_.index() <= 4) {
3052 auto d2 = wdi_.weekday() -
date::weekday(static_cast<sys_days>(y_ / m_ / 1)) +
3053 days((wdi_.index() - 1) * 7 + 1);
3054 return static_cast<unsigned>(d2.count()) <= static_cast<unsigned>((
3055 y_ / m_ /
last).day());
3061 year_month_weekday::from_days(
days d) NOEXCEPT {
3065 return {ymd.
year(), ymd.
month(), wd[(
static_cast<unsigned>(ymd.
day()) - 1) / 7 + 1]};
3071 year_month_weekday::to_days()
const NOEXCEPT
3075 ).time_since_epoch();
3083 x.weekday_indexed() == y.weekday_indexed();
3093 template<
class CharT,
class Traits>
3095 std::basic_ostream<CharT, Traits> &
3096 operator<<(std::basic_ostream<CharT, Traits> &os,
3099 return os << ymwdi.
year() <<
'/' << ymwdi.month()
3100 <<
'/' << ymwdi.weekday_indexed();
3124 return ymwd + (-dm);
3145 return ymwd + (-dy);
3222 year_month_weekday_last::operator
sys_days() const NOEXCEPT
3239 return y_.ok() && m_.ok() && wdl_.ok();
3245 year_month_weekday_last::to_days()
const NOEXCEPT
3268 template<
class CharT,
class Traits>
3270 std::basic_ostream<CharT, Traits> &
3271 operator<<(std::basic_ostream<CharT, Traits> &os,
3274 return os << ymwdl.
year() <<
'/' << ymwdl.
month() <<
'/' <<
3299 return ymwdl + (-dm);
3320 return ymwdl + (-dy);
3336 return y /
month(static_cast<unsigned>(m));
3359 return m /
day(static_cast<unsigned>(d));
3366 return month(static_cast<unsigned>(m)) / d;
3391 return month(static_cast<unsigned>(m)) /
last;
3421 return month(static_cast<unsigned>(m)) / wdi;
3451 return month(static_cast<unsigned>(m)) / wdl;
3474 return ym /
day(static_cast<unsigned>(d));
3488 return year(y) / md;
3502 return year(y) / md;
3525 return year(y) / mdl;
3539 return year(y) / mdl;
3562 return year(y) / mwd;
3576 return year(y) / mwd;
3599 return year(y) / mwdl;
3613 return year(y) / mwdl;
3616 template <
class Duration>
3619 template <
class CharT,
class Traits,
class Duration>
3620 std::basic_ostream<CharT, Traits> &
3621 to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
3623 const std::chrono::seconds *offset_sec =
nullptr);
3625 template <
class CharT,
class Traits,
class Duration,
class Alloc>
3626 std::basic_istream<CharT, Traits> &
3627 from_stream(std::basic_istream<CharT, Traits> &is,
const CharT *fmt,
3630 std::chrono::minutes *offset =
nullptr);
3649 template < std::uint64_t n, std::uint64_t d = 10,
unsigned w = 0,
3650 bool should_continue = !(n < 2) && d != 0 && (w < 19) >
3655 template <std::u
int64_t n, std::u
int64_t d,
unsigned w>
3660 template <
unsigned exp>
3665 static CONSTDATA std::uint64_t value = h * h * (exp % 2 ? 10 : 1);
3673 template <
class Duration>
3675 using CT =
typename std::common_type<Duration, std::chrono::seconds>::type;
3676 using rep =
typename CT::rep;
3680 using precision = std::chrono::duration<rep,
3681 std::ratio<1, static_pow10<width>::value>>;
3684 std::chrono::seconds s_;
3695 s_(std::chrono::duration_cast<std::chrono::seconds>(d))
3696 , sub_s_(std::chrono::treat_as_floating_point<rep>::value ? d - s_ :
3697 std::chrono::duration_cast<precision>(d - s_))
3717 return sub_s_ < std::chrono::seconds{1} &&s_ < std::chrono::minutes{1};
3720 template <
class CharT,
class Traits>
3722 std::basic_ostream<CharT, Traits> &
3723 operator<<(std::basic_ostream<CharT, Traits> &os,
3726 return x.print(os, std::chrono::treat_as_floating_point<rep> {});
3729 template <
class CharT,
class Traits>
3730 std::basic_ostream<CharT, Traits> &
3731 print(std::basic_ostream<CharT, Traits> &os, std::true_type)
const 3734 std::chrono::duration<rep> d = s_ + sub_s_;
3735 if (d < std::chrono::seconds{10})
3737 os << std::fixed << d.count();
3741 template <
class CharT,
class Traits>
3742 std::basic_ostream<CharT, Traits> &
3743 print(std::basic_ostream<CharT, Traits> &os, std::false_type)
const 3752 os << std::use_facet<std::numpunct<CharT>>(os.getloc()).decimal_point();
3757 os << sub_s_.count();
3763 template <
class Rep,
class Period>
3766 typename std::enable_if
3768 std::numeric_limits<Rep>::is_signed,
3769 std::chrono::duration<Rep, Period>
3771 abs(std::chrono::duration<Rep, Period> d)
3773 return d >= d.zero() ? +d : -d;
3776 template <
class Rep,
class Period>
3779 typename std::enable_if
3781 !std::numeric_limits<Rep>::is_signed,
3782 std::chrono::duration<Rep, Period>
3784 abs(std::chrono::duration<Rep, Period> d)
3791 template <
class Duration>
3794 std::chrono::seconds>::type>;
3796 std::chrono::hours h_;
3797 std::chrono::minutes m_;
3812 h_(std::chrono::duration_cast<std::chrono::hours>(
detail::abs(d)))
3813 , m_(std::chrono::duration_cast<std::chrono::minutes>(
detail::abs(d)) - h_)
3815 , neg_(d < Duration::zero())
3843 return to_duration();
3847 return (h_ + m_ + s_.
to_duration()) * (1 - 2 * neg_);
3852 return !neg_ && h_ <
days{1} &&m_ < std::chrono::hours{1} &&
3858 template <
class charT,
class traits>
3860 std::basic_ostream<charT, traits> &
3861 operator<<(std::basic_ostream<charT, traits> &os,
hh_mm_ss const &tod)
3863 if (tod.is_negative()) {
3866 if (tod.h_ < std::chrono::hours{10})
3868 os << tod.h_.count() <<
':';
3869 if (tod.m_ < std::chrono::minutes{10})
3871 os << tod.m_.count() <<
':' << tod.s_;
3875 template <
class CharT,
class Traits,
class Duration2>
3877 std::basic_ostream<CharT, Traits> &
3878 date::to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
3880 const std::chrono::seconds *offset_sec);
3882 template <
class CharT,
class Traits,
class Duration2,
class Alloc>
3884 std::basic_istream<CharT, Traits> &
3887 std::basic_string<CharT, Traits, Alloc> *abbrev, std::chrono::minutes *offset);
3893 is_am(std::chrono::hours
const &h) NOEXCEPT {
3894 using std::chrono::hours;
3895 return hours{0} <= h &&h < hours{12};
3901 is_pm(std::chrono::hours
const &h) NOEXCEPT {
3902 using std::chrono::hours;
3903 return hours{12} <= h &&h < hours{24};
3910 using std::chrono::hours;
3928 using std::chrono::hours;
3934 else if (h == hours{12})
3939 template <
class Duration>
3942 template <
class Rep,
class Period,
3943 class =
typename std::enable_if
3944 < !std::chrono::treat_as_floating_point<Rep>::value >::type >
3953 template <
class CharT,
class Traits,
class Duration>
3955 typename std::enable_if
3957 !std::chrono::treat_as_floating_point<typename Duration::rep>::value &&
3958 std::ratio_less<typename Duration::period, days::period>::value
3959 , std::basic_ostream<CharT, Traits> &
3963 auto const dp = date::floor<days>(tp);
3967 template <
class CharT,
class Traits>
3969 std::basic_ostream<CharT, Traits> &
3970 operator<<(std::basic_ostream<CharT, Traits> &os,
const sys_days &dp)
3975 template <
class CharT,
class Traits,
class Duration>
3977 std::basic_ostream<CharT, Traits> &
3978 operator<<(std::basic_ostream<CharT, Traits> &os,
3986 template <
class CharT, std::
size_t N>
3989 template <
class CharT1,
class CharT2, std::
size_t N1, std::
size_t N2>
3992 string_literal <
typename std::conditional <
sizeof(CharT2) <=
sizeof(CharT1),
3993 CharT1, CharT2 >::type,
3998 template <
class CharT, std::
size_t N>
4008 using const_iterator =
const CharT*;
4013 template <std::size_t N1 = 2,
4014 class =
typename std::enable_if<N1 == N>::type>
4020 template <std::size_t N1 = 3,
4021 class =
typename std::enable_if<N1 == N>::type>
4027 template <std::size_t N1 = 4,
4028 class =
typename std::enable_if<N1 == N>::type>
4037 for (std::size_t
i = 0;
i < N; ++
i)
4043 template <
class U = CharT,
4044 class =
typename std::enable_if<(1 < sizeof(U))>::type>
4048 for (std::size_t
i = 0;
i < N; ++
i) {
4053 template <
class CharT2,
4054 class =
typename std::enable_if < !std::is_same<CharT2, CharT>::value >::type >
4058 for (std::size_t
i = 0;
i < N; ++
i) {
4063 CONSTCD11 const CharT *data() const NOEXCEPT
4067 CONSTCD11 std::size_t size() const NOEXCEPT
4072 CONSTCD11 const_iterator begin() const NOEXCEPT
4076 CONSTCD11 const_iterator end() const NOEXCEPT
4081 CONSTCD11 CharT
const &operator[](std::size_t n)
const NOEXCEPT
4086 template <
class Traits>
4088 std::basic_ostream<CharT, Traits> &
4089 operator<<(std::basic_ostream<CharT, Traits> &os,
const string_literal &
s)
4094 template <
class CharT1,
class CharT2, std::
size_t N1, std::
size_t N2>
4097 string_literal <
typename std::conditional <
sizeof(CharT2) <=
sizeof(CharT1),
4098 CharT1, CharT2 >::type,
4104 template <
class CharT>
4113 template <
class CharT>
4122 template <
class CharT1,
class CharT2, std::
size_t N1, std::
size_t N2>
4125 string_literal <
typename std::conditional <
sizeof(CharT2) <=
sizeof(CharT1),
4126 CharT1, CharT2 >::type,
4130 using CT =
typename std::conditional < sizeof(CharT2) <= sizeof(CharT1), CharT1, CharT2 >::type;
4134 for (; i < N1 - 1; ++
i)
4136 r.p_[
i] = CT(x.p_[i]);
4138 for (std::size_t
j = 0;
j < N2; ++
j, ++
i)
4140 r.p_[
i] = CT(y.p_[
j]);
4147 template <
class CharT,
class Traits,
class Alloc, std::
size_t N>
4149 std::basic_string<CharT, Traits, Alloc>
4150 operator+(std::basic_string<CharT, Traits, Alloc> x,
4153 x.append(y.data(), y.size());
4157 #if __cplusplus >= 201402 && (!defined(__EDG_VERSION__) || __EDG_VERSION__ > 411) \ 4158 && (!defined(__SUNPRO_CC) || __SUNPRO_CC > 0x5150) 4160 template <
class CharT,
4161 class = std::enable_if_t < std::is_same<CharT, char> {} ||
4162 std::is_same<CharT, wchar_t> {} ||
4163 std::is_same<CharT, char16_t> {} ||
4164 std::is_same<CharT, char32_t> {} >>
4168 msl(CharT c) NOEXCEPT {
4175 to_string_len(std::intmax_t i)
4186 template <std::
intmax_t N>
4195 return msl(
char(N % 10 +
'0'));
4198 template <std::
intmax_t N>
4207 return msl < N / 10 > () + msl(
char(N % 10 +
'0'));
4210 template <
class CharT, std::
intmax_t N, std::
intmax_t D>
4219 msl(std::ratio<N, D>) NOEXCEPT {
4220 using R =
typename std::ratio<N, D>::type;
4221 return msl(CharT{
'['}) + msl<R::num>() + msl(CharT{
'/'}) +
4222 msl<R::den>() + msl(CharT{
']'});
4225 template <
class CharT, std::
intmax_t N, std::
intmax_t D>
4233 msl(std::ratio<N, D>) NOEXCEPT {
4234 using R =
typename std::ratio<N, D>::type;
4235 return msl(CharT{
'['}) + msl<R::num>() + msl(CharT{
']'});
4239 #else // __cplusplus < 201402 || (defined(__EDG_VERSION__) && __EDG_VERSION__ <= 411) 4243 to_string(std::uint64_t x)
4245 return std::to_string(x);
4248 template <
class CharT>
4250 std::basic_string<CharT>
4251 to_string(std::uint64_t x)
4253 auto y = std::to_string(x);
4254 return std::basic_string<CharT>(y.begin(), y.end());
4257 template <
class CharT, std::
intmax_t N, std::
intmax_t D>
4259 typename std::enable_if
4261 std::ratio<N, D>::type::den != 1,
4262 std::basic_string<CharT>
4264 msl(std::ratio<N, D>)
4266 using R =
typename std::ratio<N, D>::type;
4267 return std::basic_string<CharT>(1,
'[') + to_string<CharT>(R::num) + CharT{
'/'} +
4268 to_string<CharT>(
R::den) + CharT{
']'};
4271 template <
class CharT, std::
intmax_t N, std::
intmax_t D>
4273 typename std::enable_if
4275 std::ratio<N, D>::type::den == 1,
4276 std::basic_string<CharT>
4278 msl(std::ratio<N, D>)
4280 using R =
typename std::ratio<N, D>::type;
4281 return std::basic_string<CharT>(1,
'[') + to_string<CharT>(R::num) + CharT{
']'};
4284 #endif // __cplusplus < 201402 || (defined(__EDG_VERSION__) && __EDG_VERSION__ <= 411) 4286 template <
class CharT>
4290 msl(std::atto) NOEXCEPT {
4294 template <
class CharT>
4298 msl(std::femto) NOEXCEPT {
4302 template <
class CharT>
4306 msl(std::pico) NOEXCEPT {
4310 template <
class CharT>
4314 msl(std::nano) NOEXCEPT {
4318 template <
class CharT>
4321 typename std::enable_if
4323 std::is_same<CharT, char>::value,
4326 msl(std::micro) NOEXCEPT {
4330 template <
class CharT>
4333 typename std::enable_if
4335 !std::is_same<CharT, char>::value,
4338 msl(std::micro) NOEXCEPT {
4342 template <
class CharT>
4346 msl(std::milli) NOEXCEPT {
4350 template <
class CharT>
4354 msl(std::centi) NOEXCEPT {
4358 template <
class CharT>
4362 msl(std::deca) NOEXCEPT {
4366 template <
class CharT>
4370 msl(std::deci) NOEXCEPT {
4374 template <
class CharT>
4378 msl(std::hecto) NOEXCEPT {
4382 template <
class CharT>
4386 msl(std::kilo) NOEXCEPT {
4390 template <
class CharT>
4394 msl(std::mega) NOEXCEPT {
4398 template <
class CharT>
4402 msl(std::giga) NOEXCEPT {
4406 template <
class CharT>
4410 msl(std::tera) NOEXCEPT {
4414 template <
class CharT>
4418 msl(std::peta) NOEXCEPT {
4422 template <
class CharT>
4426 msl(std::exa) NOEXCEPT {
4430 template <
class CharT,
class Period>
4440 template <
class CharT>
4444 get_units(std::ratio<1>)
4449 template <
class CharT>
4453 get_units(std::ratio<3600>)
4458 template <
class CharT>
4462 get_units(std::ratio<60>)
4467 template <
class CharT>
4471 get_units(std::ratio<86400>)
4476 template <
class CharT,
class Traits = std::
char_traits<CharT>>
4480 struct make_string<char> {
4481 template <
class Rep>
4486 return std::to_string(n);
4490 template <
class Traits>
4491 struct make_string<char, Traits> {
4492 template <
class Rep>
4494 std::basic_string<char, Traits>
4497 auto s = std::to_string(n);
4498 return std::basic_string<char, Traits>(
s.begin(),
s.end());
4503 struct make_string<wchar_t> {
4504 template <
class Rep>
4509 return std::to_wstring(n);
4513 template <
class Traits>
4514 struct make_string<wchar_t, Traits> {
4515 template <
class Rep>
4517 std::basic_string<wchar_t, Traits>
4520 auto s = std::to_wstring(n);
4521 return std::basic_string<wchar_t, Traits>(
s.begin(),
s.end());
4531 template <
class Duration>
4536 bool has_tod =
false;
4561 template <
class CharT,
class Traits,
class Duration>
4566 if (!fds.
ymd.ok() && !fds.
wd.ok()) {
4568 os.setstate(std::ios::failbit);
4574 if (fds.
wd.ok() && wd != fds.
wd) {
4576 os.setstate(std::ios::failbit);
4583 return static_cast<unsigned>((wd -
Sunday).
count());
4586 template <
class CharT,
class Traits,
class Duration>
4591 if (!fds.
ymd.month().ok()) {
4593 os.setstate(std::ios::failbit);
4596 return static_cast<unsigned>(fds.
ymd.month());
4606 std::pair<const std::string *, const std::string *>
4609 static const std::string nm[] = {
4625 return std::make_pair(nm, nm +
sizeof(nm) /
sizeof(nm[0]));
4629 std::pair<const std::string *, const std::string *>
4632 static const std::string nm[] = {
4658 return std::make_pair(nm, nm +
sizeof(nm) /
sizeof(nm[0]));
4662 std::pair<const std::string *, const std::string *>
4665 static const std::string nm[] = {
4669 return std::make_pair(nm, nm +
sizeof(nm) /
sizeof(nm[0]));
4672 template <
class CharT,
class Traits,
class FwdIter>
4674 scan_keyword(std::basic_istream<CharT, Traits> &is, FwdIter kb, FwdIter ke)
4676 size_t nkw =
static_cast<size_t>(std::distance(kb, ke));
4677 const unsigned char doesnt_match =
'\0';
4678 const unsigned char might_match =
'\1';
4679 const unsigned char does_match =
'\2';
4680 unsigned char statbuf[100];
4681 unsigned char *status = statbuf;
4682 std::unique_ptr<unsigned char, void(*)(void *)> stat_hold(0, free);
4683 if (nkw >
sizeof(statbuf)) {
4684 status = (
unsigned char *)std::malloc(nkw);
4685 if (status ==
nullptr) {
4686 throw std::bad_alloc();
4688 stat_hold.reset(status);
4690 size_t n_might_match = nkw;
4691 size_t n_does_match = 0;
4693 unsigned char *st = status;
4694 for (
auto ky = kb; ky != ke; ++ky, ++st) {
4705 for (
size_t indx = 0; is && n_might_match > 0; ++indx) {
4707 auto ic = is.peek();
4709 is.setstate(std::ios::eofbit);
4712 auto c =
static_cast<char>(toupper(ic));
4713 bool consume =
false;
4721 for (
auto ky = kb; ky != ke; ++ky, ++st) {
4722 if (*st == might_match) {
4723 if (c == static_cast<char>(toupper((*ky)[indx]))) {
4725 if (ky->size() == indx + 1) {
4743 if (n_might_match + n_does_match > 1) {
4745 for (
auto ky = kb; ky != ke; ++ky, ++st) {
4746 if (*st == does_match && ky->size() != indx + 1) {
4756 for (st = status; kb != ke; ++kb, ++st)
4757 if (*st == does_match) {
4761 is.setstate(std::ios::failbit);
4768 #endif // ONLY_C_LOCALE 4770 template <
class CharT,
class Traits,
class Duration>
4771 std::basic_ostream<CharT, Traits> &
4772 to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
4774 const std::chrono::seconds *offset_sec)
4777 using detail::weekday_names;
4778 using detail::month_names;
4779 using detail::ampm_names;
4782 using detail::get_units;
4786 using std::chrono::duration_cast;
4787 using std::chrono::seconds;
4788 using std::chrono::minutes;
4789 using std::chrono::hours;
4795 bool insert_negative = fds.
has_tod && fds.
tod.to_duration() < Duration::zero();
4797 auto &facet = std::use_facet<std::time_put<CharT>>(os.getloc());
4799 const CharT *command =
nullptr;
4800 CharT modified = CharT{};
4801 for (; *fmt; ++fmt) {
4806 if (modified == CharT{}) {
4812 const CharT f[] = {
'%', *fmt};
4813 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
4814 #else // ONLY_C_LOCALE 4815 os << weekday_names().first[tm.tm_wday + 7 * (*fmt ==
'a')];
4816 #endif // ONLY_C_LOCALE 4819 os << CharT{
'%'} << modified << *fmt;
4832 if (modified == CharT{}) {
4835 const CharT f[] = {
'%', *fmt};
4836 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
4837 #else // ONLY_C_LOCALE 4838 os << month_names().first[tm.tm_mon + 12 * (*fmt !=
'B')];
4839 #endif // ONLY_C_LOCALE 4842 os << CharT{
'%'} << modified << *fmt;
4854 if (modified == CharT{
'O'})
4855 os << CharT{
'%'} << modified << *fmt;
4857 if (!fds.
ymd.ok()) {
4858 os.setstate(std::ios::failbit);
4860 if (*fmt ==
'c' && !fds.
has_tod) {
4861 os.setstate(std::ios::failbit);
4865 auto const &ymd = fds.
ymd;
4868 tm.tm_sec =
static_cast<int>(fds.
tod.seconds().count());
4869 tm.tm_min =
static_cast<int>(fds.
tod.minutes().count());
4870 tm.tm_hour =
static_cast<int>(fds.
tod.hours().count());
4872 tm.tm_mday =
static_cast<int>(
static_cast<unsigned>(ymd.
day()));
4874 tm.tm_year =
static_cast<int>(ymd.
year()) - 1900;
4879 tm.tm_yday =
static_cast<int>((ld -
local_days(ymd.
year() / 1 / 1)).count());
4881 auto fe = std::begin(f) + 1;
4882 if (modified == CharT{
'E'})
4885 facet.put(os, os, os.fill(), &tm, std::begin(f), fe);
4886 #else // ONLY_C_LOCALE 4889 os << weekday_names().first[
static_cast<unsigned>(wd) + 7]
4891 os << month_names().first[
extract_month(os, fds) - 1 + 12] <<
' ';
4892 auto d =
static_cast<int>(
static_cast<unsigned>(fds.
ymd.day()));
4897 <<
make_time(duration_cast<seconds>(fds.
tod.to_duration()))
4898 <<
' ' << fds.
ymd.year();
4902 auto const &ymd = fds.
ymd;
4903 save_ostream<CharT, Traits> _(os);
4907 os << static_cast<unsigned>(ymd.
month()) << CharT{
'/'};
4909 os << static_cast<unsigned>(ymd.
day()) << CharT{
'/'};
4911 os << static_cast<int>(ymd.
year()) % 100;
4913 #endif // ONLY_C_LOCALE 4924 if (modified == CharT{
'O'})
4925 os << CharT{
'%'} << modified << *fmt;
4927 if (!fds.
ymd.year().ok()) {
4928 os.setstate(std::ios::failbit);
4930 auto y =
static_cast<int>(fds.
ymd.year());
4932 if (modified == CharT {})
4935 save_ostream<CharT, Traits> _(os);
4945 os << -(y - 99) / 100;
4949 else if (modified == CharT {
'E'}) {
4950 tm.tm_year = y - 1900;
4951 CharT f[3] = {
'%',
'E',
'C'};
4952 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
4966 if (modified == CharT{
'E'})
4967 os << CharT{
'%'} << modified << *fmt;
4969 if (!fds.
ymd.day().ok()) {
4970 os.setstate(std::ios::failbit);
4972 auto d =
static_cast<int>(
static_cast<unsigned>(fds.
ymd.day()));
4974 if (modified == CharT {})
4977 save_ostream<CharT, Traits> _(os);
4978 if (*fmt == CharT{
'd'})
4988 else if (modified == CharT {
'O'}) {
4990 CharT f[3] = {
'%',
'O', *fmt};
4991 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5004 if (modified == CharT{}) {
5005 if (!fds.
ymd.ok()) {
5006 os.setstate(std::ios::failbit);
5008 auto const &ymd = fds.
ymd;
5009 save_ostream<CharT, Traits> _(os);
5013 os << static_cast<unsigned>(ymd.
month()) << CharT{
'/'};
5015 os << static_cast<unsigned>(ymd.
day()) << CharT{
'/'};
5017 os << static_cast<int>(ymd.
year()) % 100;
5020 os << CharT{
'%'} << modified << *fmt;
5031 if (modified == CharT{}) {
5032 if (!fds.
ymd.ok()) {
5033 os.setstate(std::ios::failbit);
5035 auto const &ymd = fds.
ymd;
5036 save_ostream<CharT, Traits> _(os);
5040 os << static_cast<int>(ymd.
year()) << CharT{
'-'};
5042 os << static_cast<unsigned>(ymd.
month()) << CharT{
'-'};
5044 os << static_cast<unsigned>(ymd.
day());
5047 os << CharT{
'%'} << modified << *fmt;
5059 if (modified == CharT{}) {
5060 if (!fds.
ymd.ok()) {
5061 os.setstate(std::ios::failbit);
5070 if (*fmt == CharT{
'G'})
5073 save_ostream<CharT, Traits> _(os);
5077 os << std::abs(static_cast<int>(y)) % 100;
5081 os << CharT{
'%'} << modified << *fmt;
5093 if (modified == CharT{
'E'})
5094 os << CharT{
'%'} << modified << *fmt;
5097 os.setstate(std::ios::failbit);
5099 if (insert_negative) {
5101 insert_negative =
false;
5105 if (modified == CharT {})
5108 auto h = *fmt == CharT{
'I'} ?
make12(hms.hours()) : hms.hours();
5114 else if (modified == CharT {
'O'}) {
5115 const CharT f[] = {
'%', modified, *fmt};
5116 tm.tm_hour =
static_cast<int>(hms.hours().count());
5117 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5130 if (modified == CharT{}) {
5135 auto y = fds.
ymd.year();
5139 doy = duration_cast<
days>(fds.
tod.to_duration());
5141 save_ostream<CharT, Traits> _(os);
5148 os.setstate(std::ios::failbit);
5152 os << CharT{
'%'} << modified << *fmt;
5163 if (modified == CharT{
'E'})
5164 os << CharT{
'%'} << modified << *fmt;
5166 if (!fds.
ymd.month().ok()) {
5167 os.setstate(std::ios::failbit);
5169 auto m =
static_cast<unsigned>(fds.
ymd.month());
5171 if (modified == CharT {})
5179 else if (modified == CharT {
'O'}) {
5180 const CharT f[] = {
'%', modified, *fmt};
5181 tm.tm_mon =
static_cast<int>(m - 1);
5182 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5195 if (modified == CharT{
'E'})
5196 os << CharT{
'%'} << modified << *fmt;
5199 os.setstate(std::ios::failbit);
5201 if (insert_negative) {
5203 insert_negative =
false;
5206 if (modified == CharT {})
5209 if (fds.
tod.minutes() < minutes{10})
5211 os << fds.
tod.minutes().count();
5214 else if (modified == CharT {
'O'}) {
5215 const CharT f[] = {
'%', modified, *fmt};
5216 tm.tm_min =
static_cast<int>(fds.
tod.minutes().count());
5217 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5230 if (modified == CharT{})
5233 os << CharT{
'%'} << modified << *fmt;
5244 if (modified == CharT{}) {
5246 os.setstate(std::ios::failbit);
5249 const CharT f[] = {
'%', *fmt};
5250 tm.tm_hour =
static_cast<int>(fds.
tod.hours().count());
5251 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5254 os << ampm_names().first[0];
5257 os << ampm_names().first[1];
5262 os << CharT{
'%'} << modified << *fmt;
5274 if (modified == CharT{}) {
5276 os.setstate(std::ios::failbit);
5278 auto d = fds.
tod.to_duration();
5280 os << get_units<CharT>(
typename decltype(d)::period::type{});
5286 os << CharT{
'%'} << modified << *fmt;
5297 if (modified == CharT{}) {
5299 os.setstate(std::ios::failbit);
5302 const CharT f[] = {
'%', *fmt};
5303 tm.tm_hour =
static_cast<int>(fds.
tod.hours().count());
5304 tm.tm_min =
static_cast<int>(fds.
tod.minutes().count());
5305 tm.tm_sec =
static_cast<int>(fds.
tod.seconds().count());
5306 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5309 save_ostream<CharT, Traits> _(os);
5314 os << tod.
minutes().count() << CharT{
':'};
5316 os << tod.
seconds().count() << CharT{
' '};
5318 os << ampm_names().first[0];
5321 os << ampm_names().first[1];
5326 os << CharT{
'%'} << modified << *fmt;
5337 if (modified == CharT{}) {
5339 os.setstate(std::ios::failbit);
5341 if (fds.
tod.hours() < hours{10})
5343 os << fds.
tod.hours().count() << CharT{
':'};
5344 if (fds.
tod.minutes() < minutes{10})
5346 os << fds.
tod.minutes().count();
5349 os << CharT{
'%'} << modified << *fmt;
5360 if (modified == CharT{
'E'})
5361 os << CharT{
'%'} << modified << *fmt;
5364 os.setstate(std::ios::failbit);
5366 if (insert_negative) {
5368 insert_negative =
false;
5371 if (modified == CharT {})
5377 else if (modified == CharT {
'O'}) {
5378 const CharT f[] = {
'%', modified, *fmt};
5379 tm.tm_sec =
static_cast<int>(fds.
tod.s_.seconds().count());
5380 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5393 if (modified == CharT{})
5396 os << CharT{
'%'} << modified << *fmt;
5407 if (modified == CharT{}) {
5409 os.setstate(std::ios::failbit);
5414 os << CharT{
'%'} << modified << *fmt;
5425 if (modified == CharT{
'E'})
5426 os << CharT{
'%'} << modified << *fmt;
5430 if (modified == CharT {})
5433 os << (wd != 0 ? wd : 7
u);
5436 else if (modified == CharT {
'O'}) {
5437 const CharT f[] = {
'%', modified, *fmt};
5438 tm.tm_wday =
static_cast<int>(wd);
5439 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5452 if (modified == CharT{
'E'})
5453 os << CharT{
'%'} << modified << *fmt;
5455 auto const &ymd = fds.
ymd;
5457 os.setstate(std::ios::failbit);
5461 if (modified == CharT {})
5466 os << CharT{
'0'} << CharT{
'0'};
5468 auto wn = duration_cast<
weeks>(ld - st).
count() + 1;
5475 else if (modified == CharT {
'O'}) {
5476 const CharT f[] = {
'%', modified, *fmt};
5477 tm.tm_year =
static_cast<int>(ymd.
year()) - 1900;
5482 tm.tm_yday =
static_cast<int>((ld -
local_days(ymd.
year() / 1 / 1)).count());
5483 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5496 if (modified == CharT{
'E'})
5497 os << CharT{
'%'} << modified << *fmt;
5499 if (!fds.
ymd.ok()) {
5500 os.setstate(std::ios::failbit);
5504 if (modified == CharT {})
5515 auto wn = duration_cast<
weeks>(ld - st).
count() + 1;
5521 else if (modified == CharT {
'O'}) {
5522 const CharT f[] = {
'%', modified, *fmt};
5523 auto const &ymd = fds.
ymd;
5524 tm.tm_year =
static_cast<int>(ymd.
year()) - 1900;
5529 tm.tm_yday =
static_cast<int>((ld -
local_days(ymd.
year() / 1 / 1)).count());
5530 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5548 if (modified == CharT {})
5550 if (modified != CharT {
'E'})
5556 else if (modified == CharT {
'O'}) {
5557 const CharT f[] = {
'%', modified, *fmt};
5558 tm.tm_wday =
static_cast<int>(wd);
5559 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5563 os << CharT{
'%'} << modified << *fmt;
5574 if (modified == CharT{
'E'})
5575 os << CharT{
'%'} << modified << *fmt;
5577 auto const &ymd = fds.
ymd;
5579 os.setstate(std::ios::failbit);
5583 if (modified == CharT {})
5588 os << CharT{
'0'} << CharT{
'0'};
5590 auto wn = duration_cast<
weeks>(ld - st).
count() + 1;
5597 else if (modified == CharT {
'O'}) {
5598 const CharT f[] = {
'%', modified, *fmt};
5599 tm.tm_year =
static_cast<int>(ymd.
year()) - 1900;
5604 tm.tm_yday =
static_cast<int>((ld -
local_days(ymd.
year() / 1 / 1)).count());
5605 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5618 if (modified == CharT{
'O'})
5619 os << CharT{
'%'} << modified << *fmt;
5622 os.setstate(std::ios::failbit);
5626 tm.tm_sec =
static_cast<int>(fds.
tod.seconds().count());
5627 tm.tm_min =
static_cast<int>(fds.
tod.minutes().count());
5628 tm.tm_hour =
static_cast<int>(fds.
tod.hours().count());
5630 auto fe = std::begin(f) + 1;
5631 if (modified == CharT{
'E'})
5634 facet.put(os, os, os.fill(), &tm, std::begin(f), fe);
5648 if (!fds.
ymd.year().ok()) {
5649 os.setstate(std::ios::failbit);
5651 auto y =
static_cast<int>(fds.
ymd.year());
5653 if (modified == CharT {}) {
5662 const CharT f[] = {
'%', modified, *fmt};
5663 tm.tm_year = y - 1900;
5664 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5667 modified = CharT {};
5676 if (modified == CharT{
'O'})
5677 os << CharT{
'%'} << modified << *fmt;
5679 if (!fds.
ymd.year().ok()) {
5680 os.setstate(std::ios::failbit);
5682 auto y = fds.
ymd.year();
5684 if (modified == CharT {})
5690 else if (modified == CharT {
'E'}) {
5691 const CharT f[] = {
'%', modified, *fmt};
5692 tm.tm_year =
static_cast<int>(y) - 1900;
5693 facet.put(os, os, os.fill(), &tm, std::begin(f), std::end(f));
5706 if (offset_sec ==
nullptr) {
5708 os.setstate(ios::failbit);
5711 auto m = duration_cast<minutes>(*offset_sec);
5712 auto neg = m < minutes{0};
5714 auto h = duration_cast<hours>(m);
5723 if (modified != CharT{})
5725 if (m < minutes{10})
5737 if (modified == CharT{}) {
5738 if (abbrev ==
nullptr) {
5740 os.setstate(ios::failbit);
5743 for (
auto c : *abbrev) {
5748 os << CharT{
'%'} << modified << *fmt;
5760 if (modified == CharT{}) {
5764 os << CharT{
'%'} << modified << *fmt;
5775 if (modified == CharT{}) {
5780 os << CharT{
'%'} << modified << CharT{
'%'};
5794 if (modified != CharT{}) {
5804 if (modified != CharT{})
5809 template <
class CharT,
class Traits>
5811 std::basic_ostream<CharT, Traits> &
5812 to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
5815 using CT = std::chrono::seconds;
5820 template <
class CharT,
class Traits>
5822 std::basic_ostream<CharT, Traits> &
5823 to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
5826 using CT = std::chrono::seconds;
5831 template <
class CharT,
class Traits>
5833 std::basic_ostream<CharT, Traits> &
5834 to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
const day &d)
5836 using CT = std::chrono::seconds;
5841 template <
class CharT,
class Traits>
5843 std::basic_ostream<CharT, Traits> &
5844 to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
5847 using CT = std::chrono::seconds;
5852 template <
class CharT,
class Traits>
5854 std::basic_ostream<CharT, Traits> &
5855 to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
5858 using CT = std::chrono::seconds;
5863 template <
class CharT,
class Traits>
5865 std::basic_ostream<CharT, Traits> &
5866 to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
5869 using CT = std::chrono::seconds;
5874 template <
class CharT,
class Traits>
5876 std::basic_ostream<CharT, Traits> &
5877 to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
5880 using CT = std::chrono::seconds;
5885 template <
class CharT,
class Traits,
class Rep,
class Period>
5887 std::basic_ostream<CharT, Traits> &
5888 to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
5889 const std::chrono::duration<Rep, Period> &d)
5891 using Duration = std::chrono::duration<Rep, Period>;
5892 using CT =
typename std::common_type<Duration, std::chrono::seconds>::type;
5897 template <
class CharT,
class Traits,
class Duration>
5898 std::basic_ostream<CharT, Traits> &
5899 to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
5901 const std::chrono::seconds *offset_sec =
nullptr)
5903 using CT =
typename std::common_type<Duration, std::chrono::seconds>::type;
5904 auto ld = floor<days>(tp);
5906 return to_stream(os, fmt, fds, abbrev, offset_sec);
5909 template <
class CharT,
class Traits,
class Duration>
5910 std::basic_ostream<CharT, Traits> &
5911 to_stream(std::basic_ostream<CharT, Traits> &os,
const CharT *fmt,
5914 using std::chrono::seconds;
5915 using CT =
typename std::common_type<Duration, seconds>::type;
5916 const std::string abbrev(
"UTC");
5918 auto sd = floor<days>(tp);
5920 return to_stream(os, fmt, fds, &abbrev, &offset);
5925 template <
class CharT,
class Streamable>
5927 format(
const std::locale &
loc,
const CharT *fmt,
const Streamable &tp)
5928 -> decltype(
to_stream(std::declval<std::basic_ostream<CharT>&>(), fmt, tp),
5929 std::basic_string<CharT> {})
5931 std::basic_ostringstream<CharT> os;
5932 os.exceptions(std::ios::failbit | std::ios::badbit);
5938 template <
class CharT,
class Streamable>
5940 format(
const CharT *fmt,
const Streamable &tp)
5941 -> decltype(
to_stream(std::declval<std::basic_ostream<CharT>&>(), fmt, tp),
5942 std::basic_string<CharT> {})
5944 std::basic_ostringstream<CharT> os;
5945 os.exceptions(std::ios::failbit | std::ios::badbit);
5950 template <
class CharT,
class Traits,
class Alloc,
class Streamable>
5953 const std::basic_string<CharT, Traits, Alloc> &fmt,
5954 const Streamable &tp)
5955 -> decltype(
to_stream(std::declval<std::basic_ostream<CharT, Traits>&>(),
5957 std::basic_string<CharT, Traits, Alloc> {})
5959 std::basic_ostringstream<CharT, Traits, Alloc> os;
5960 os.exceptions(std::ios::failbit | std::ios::badbit);
5966 template <
class CharT,
class Traits,
class Alloc,
class Streamable>
5968 format(
const std::basic_string<CharT, Traits, Alloc> &fmt,
const Streamable &tp)
5969 -> decltype(
to_stream(std::declval<std::basic_ostream<CharT, Traits>&>(),
5971 std::basic_string<CharT, Traits, Alloc> {})
5973 std::basic_ostringstream<CharT, Traits, Alloc> os;
5974 os.exceptions(std::ios::failbit | std::ios::badbit);
5983 template <
class CharT,
class Traits>
5986 std::ios::iostate &err)
5989 if (Traits::eq_int_type(ic, Traits::eof()) ||
5990 !Traits::eq(Traits::to_char_type(ic), fmt)) {
5991 err |= std::ios::failbit;
5992 is.setstate(std::ios::failbit);
5998 template <
class CharT,
class Traits>
6006 auto ic = is.peek();
6007 if (Traits::eq_int_type(ic, Traits::eof())) {
6010 auto c =
static_cast<char>(Traits::to_char_type(ic));
6011 if (!(
'0' <= c && c <=
'9')) {
6016 x = 10 * x +
static_cast<unsigned>(c -
'0');
6022 is.setstate(std::ios::failbit);
6027 template <
class CharT,
class Traits>
6032 auto ic = is.peek();
6033 if (!Traits::eq_int_type(ic, Traits::eof())) {
6034 auto c =
static_cast<char>(Traits::to_char_type(ic));
6035 if ((
'0' <= c && c <=
'9') || c ==
'-' || c ==
'+') {
6036 if (c ==
'-' || c ==
'+') {
6039 auto x =
static_cast<int>(
read_unsigned(is, std::max(m, 1
u), M));
6049 is.setstate(std::ios::failbit);
6054 template <
class CharT,
class Traits>
6060 auto decimal_point = Traits::to_int_type(
6061 std::use_facet<std::numpunct<CharT>>(is.getloc()).decimal_point());
6064 auto ic = is.peek();
6065 if (Traits::eq_int_type(ic, Traits::eof())) {
6068 if (Traits::eq_int_type(ic, decimal_point)) {
6070 decimal_point = Traits::eof();
6074 auto c =
static_cast<char>(Traits::to_char_type(ic));
6075 if (!(
'0' <= c && c <=
'9')) {
6086 is.setstate(std::ios::failbit);
6089 return std::stold(buf);
6110 template <
class CharT,
class Traits>
6112 read(std::basic_istream<CharT, Traits> &)
6116 template <
class CharT,
class Traits,
class ...Args>
6118 read(std::basic_istream<CharT, Traits> &is, CharT a0, Args &&...args);
6120 template <
class CharT,
class Traits,
class ...Args>
6122 read(std::basic_istream<CharT, Traits> &is,
rs a0, Args &&...args);
6124 template <
class CharT,
class Traits,
class ...Args>
6126 read(std::basic_istream<CharT, Traits> &is,
ru a0, Args &&...args);
6128 template <
class CharT,
class Traits,
class ...Args>
6130 read(std::basic_istream<CharT, Traits> &is,
int a0, Args &&...args);
6132 template <
class CharT,
class Traits,
class ...Args>
6134 read(std::basic_istream<CharT, Traits> &is,
rld a0, Args &&...args);
6136 template <
class CharT,
class Traits,
class ...Args>
6138 read(std::basic_istream<CharT, Traits> &is, CharT a0, Args &&...args)
6141 if (a0 != CharT{}) {
6142 auto ic = is.peek();
6143 if (Traits::eq_int_type(ic, Traits::eof())) {
6144 is.setstate(std::ios::failbit | std::ios::eofbit);
6147 if (!Traits::eq(Traits::to_char_type(ic), a0)) {
6148 is.setstate(std::ios::failbit);
6153 read(is, std::forward<Args>(args)...);
6156 template <
class CharT,
class Traits,
class ...Args>
6158 read(std::basic_istream<CharT, Traits> &is,
rs a0, Args &&...args)
6165 read(is, std::forward<Args>(args)...);
6168 template <
class CharT,
class Traits,
class ...Args>
6170 read(std::basic_istream<CharT, Traits> &is,
ru a0, Args &&...args)
6176 a0.
i =
static_cast<int>(x);
6177 read(is, std::forward<Args>(args)...);
6180 template <
class CharT,
class Traits,
class ...Args>
6182 read(std::basic_istream<CharT, Traits> &is,
int a0, Args &&...args)
6185 auto u =
static_cast<unsigned>(a0);
6186 CharT buf[std::numeric_limits<unsigned>::digits10 + 2] = {};
6189 *e++ =
static_cast<CharT
>(CharT(
u % 10) + CharT{
'0'});
6193 std::reverse(buf, e);
6194 for (
auto p = buf; p != e && is.rdstate() == std::ios::goodbit; ++p) {
6198 if (is.rdstate() == std::ios::goodbit) {
6199 read(is, std::forward<Args>(args)...);
6203 template <
class CharT,
class Traits,
class ...Args>
6205 read(std::basic_istream<CharT, Traits> &is,
rld a0, Args &&...args)
6212 read(is, std::forward<Args>(args)...);
6215 template <
class T,
class CharT,
class Traits>
6218 checked_set(T &value, T from, T not_a_value, std::basic_ios<CharT, Traits> &is)
6221 if (value == not_a_value) {
6222 value = std::move(from);
6224 else if (value != from) {
6225 is.setstate(std::ios::failbit);
6232 template <
class CharT,
class Traits,
class Duration,
class Alloc = std::allocator<CharT>>
6233 std::basic_istream<CharT, Traits> &
6236 std::chrono::minutes *offset)
6238 using std::numeric_limits;
6240 using std::chrono::duration;
6241 using std::chrono::duration_cast;
6242 using std::chrono::seconds;
6243 using std::chrono::minutes;
6244 using std::chrono::hours;
6245 typename std::basic_istream<CharT, Traits>::sentry ok{is,
true};
6252 auto &f = std::use_facet<std::time_get<CharT>>(is.getloc());
6255 const CharT *command =
nullptr;
6256 auto modified = CharT{};
6259 CONSTDATA int not_a_year = numeric_limits<int>::min();
6261 CONSTDATA int not_a_century = not_a_year / 100;
6264 CONSTDATA int not_a_hour = numeric_limits<int>::min();
6266 CONSTDATA int not_a_minute = not_a_hour;
6267 CONSTDATA Duration not_a_second = Duration::min();
6272 CONSTDATA minutes not_a_offset = minutes::min();
6275 int y = not_a_2digit_year;
6276 int g = not_a_2digit_year;
6278 int C = not_a_century;
6279 int m = not_a_month;
6282 int wd = not_a_weekday;
6284 int I = not_a_hour_12_value;
6286 int M = not_a_minute;
6287 Duration
s = not_a_second;
6288 int U = not_a_week_num;
6289 int V = not_a_week_num;
6290 int W = not_a_week_num;
6291 std::basic_string<CharT, Traits, Alloc> temp_abbrev;
6292 minutes temp_offset = not_a_offset;
6299 for (; *fmt != CharT{} && !is.fail(); ++fmt) {
6306 int trial_wd = not_a_weekday;
6307 if (*fmt ==
'a' || *fmt ==
'A') {
6308 if (modified == CharT{}) {
6310 ios::iostate err = ios::goodbit;
6311 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6314 trial_wd = tm.tm_wday;
6317 auto nm = detail::weekday_names();
6318 auto i = detail::scan_keyword(is, nm.first, nm.second) - nm.first;
6325 read(is, CharT{
'%'}, width, modified, *fmt);
6329 if (modified == CharT {})
6331 if (modified != CharT {
'E'})
6334 read(is, ru{trial_wd, 1, width == -1 ?
6335 1
u :
static_cast<unsigned>(width)});
6338 if (!(1 <= trial_wd && trial_wd <= 7)) {
6339 trial_wd = not_a_weekday;
6340 is.setstate(ios::failbit);
6342 else if (trial_wd == 7) {
6347 if (!(0 <= trial_wd && trial_wd <= 6)) {
6348 trial_wd = not_a_weekday;
6349 is.setstate(ios::failbit);
6355 else if (modified == CharT {
'O'}) {
6356 ios::iostate err = ios::goodbit;
6357 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6360 trial_wd = tm.tm_wday;
6365 read(is, CharT{
'%'}, width, modified, *fmt);
6367 if (trial_wd != not_a_weekday) {
6382 if (modified == CharT{}) {
6383 int ttm = not_a_month;
6385 ios::iostate err = ios::goodbit;
6386 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6387 if ((err & ios::failbit) == 0) {
6388 ttm = tm.tm_mon + 1;
6392 auto nm = detail::month_names();
6393 auto i = detail::scan_keyword(is, nm.first, nm.second) - nm.first;
6401 read(is, CharT{
'%'}, width, modified, *fmt);
6412 if (modified != CharT{
'O'}) {
6414 ios::iostate err = ios::goodbit;
6415 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6416 if ((err & ios::failbit) == 0) {
6417 checked_set(Y, tm.tm_year + 1900, not_a_year, is);
6422 checked_set(s, duration_cast<Duration>(seconds{tm.tm_sec}),
6428 auto nm = detail::weekday_names();
6429 auto i = detail::scan_keyword(is, nm.first, nm.second) - nm.first;
6430 checked_set(wd, static_cast<int>(i % 7), not_a_weekday, is);
6432 nm = detail::month_names();
6433 i = detail::scan_keyword(is, nm.first, nm.second) - nm.first;
6434 checked_set(m, static_cast<int>(i % 12 + 1), not_a_month, is);
6445 read(is, ru{tH, 1, 2}, CharT{
':'}, ru{tM, 1, 2},
6446 CharT{
':'}, rld{S, 1, w});
6449 checked_set(s, round<Duration>(duration<long double> {S}),
6452 int tY = not_a_year;
6458 read(is, CharT{
'%'}, width, modified, *fmt);
6469 if (modified != CharT{
'O'}) {
6471 ios::iostate err = ios::goodbit;
6472 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6473 if ((err & ios::failbit) == 0) {
6474 checked_set(Y, tm.tm_year + 1900, not_a_year, is);
6481 int ty = not_a_2digit_year;
6482 int tm = not_a_month;
6484 read(is, ru{tm, 1, 2}, CharT{
'/'}, ru{td, 1, 2}, CharT{
'/'},
6492 read(is, CharT{
'%'}, width, modified, *fmt);
6503 if (modified != CharT{
'O'}) {
6505 ios::iostate err = ios::goodbit;
6506 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6507 if ((err & ios::failbit) == 0) {
6510 checked_set(s, duration_cast<Duration>(seconds{tm.tm_sec}),
6518 int tH = not_a_hour;
6519 int tM = not_a_minute;
6521 read(is, ru{tH, 1, 2}, CharT{
':'}, ru{tM, 1, 2},
6522 CharT{
':'}, rld{S, 1, w});
6525 checked_set(s, round<Duration>(duration<long double> {S}),
6530 read(is, CharT{
'%'}, width, modified, *fmt);
6541 int tC = not_a_century;
6543 if (modified == CharT {}) {
6545 read(is,
rs {tC, 1, width == -1 ? 2
u :
static_cast<unsigned>(width)});
6549 ios::iostate err = ios::goodbit;
6550 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6551 if ((err & ios::failbit) == 0) {
6552 auto tY = tm.tm_year + 1900;
6553 tC = (tY >= 0 ? tY : tY - 99) / 100;
6569 if (modified == CharT{}) {
6570 int tn = not_a_month;
6572 int ty = not_a_2digit_year;
6573 read(is, ru{tn, 1, 2}, CharT{
'\0'}, CharT{
'/'}, CharT{
'\0'},
6574 ru{td, 1, 2}, CharT{
'\0'}, CharT{
'/'}, CharT{
'\0'},
6581 read(is, CharT{
'%'}, width, modified, *fmt);
6592 if (modified == CharT{}) {
6593 int tY = not_a_year;
6594 int tn = not_a_month;
6596 read(is,
rs{tY, 1, width == -1 ? 4
u :
static_cast<unsigned>(width)},
6597 CharT{
'-'}, ru{tn, 1, 2}, CharT{
'-'}, ru{td, 1, 2});
6603 read(is, CharT{
'%'}, width, modified, *fmt);
6616 if (modified == CharT {})
6618 if (modified != CharT {
'E'})
6622 read(is,
rs{td, 1, width == -1 ? 2
u :
static_cast<unsigned>(width)});
6626 else if (modified == CharT {
'O'}) {
6627 ios::iostate err = ios::goodbit;
6628 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6632 if ((err & ios::failbit) == 0) {
6639 read(is, CharT{
'%'}, width, modified, *fmt);
6651 if (modified == CharT {})
6653 if (modified != CharT {
'E'})
6656 int tH = not_a_hour;
6657 read(is, ru{tH, 1, width == -1 ? 2
u :
static_cast<unsigned>(width)});
6661 else if (modified == CharT {
'O'}) {
6662 ios::iostate err = ios::goodbit;
6663 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6664 if ((err & ios::failbit) == 0) {
6671 read(is, CharT{
'%'}, width, modified, *fmt);
6682 if (modified == CharT{}) {
6683 int tI = not_a_hour_12_value;
6685 read(is,
rs{tI, 1, width == -1 ? 2
u :
static_cast<unsigned>(width)});
6686 if (!(1 <= tI && tI <= 12)) {
6687 is.setstate(ios::failbit);
6692 read(is, CharT{
'%'}, width, modified, *fmt);
6703 if (modified == CharT{}) {
6705 read(is, ru{tj, 1, width == -1 ? 3
u :
static_cast<unsigned>(width)});
6709 read(is, CharT{
'%'}, width, modified, *fmt);
6721 if (modified == CharT {})
6723 if (modified != CharT {
'E'})
6726 int tM = not_a_minute;
6727 read(is, ru{tM, 1, width == -1 ? 2
u :
static_cast<unsigned>(width)});
6731 else if (modified == CharT {
'O'}) {
6732 ios::iostate err = ios::goodbit;
6733 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6734 if ((err & ios::failbit) == 0) {
6741 read(is, CharT{
'%'}, width, modified, *fmt);
6753 if (modified == CharT {})
6755 if (modified != CharT {
'E'})
6758 int tn = not_a_month;
6759 read(is,
rs{tn, 1, width == -1 ? 2
u :
static_cast<unsigned>(width)});
6763 else if (modified == CharT {
'O'}) {
6764 ios::iostate err = ios::goodbit;
6765 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6766 if ((err & ios::failbit) == 0) {
6773 read(is, CharT{
'%'}, width, modified, *fmt);
6785 if (modified == CharT{}) {
6788 auto ic = is.peek();
6789 if (Traits::eq_int_type(ic, Traits::eof())) {
6790 ios::iostate err = ios::eofbit;
6792 err |= ios::failbit;
6800 else if (*fmt ==
'n') {
6801 is.setstate(ios::failbit);
6805 read(is, CharT{
'%'}, width, modified, *fmt);
6816 if (modified == CharT{}) {
6817 int tp = not_a_ampm;
6821 ios::iostate err = ios::goodbit;
6822 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6824 if (tm.tm_hour == 1) {
6827 else if (tm.tm_hour == 13) {
6834 auto nm = detail::ampm_names();
6835 auto i = detail::scan_keyword(is, nm.first, nm.second) - nm.first;
6841 read(is, CharT{
'%'}, width, modified, *fmt);
6853 if (modified == CharT{}) {
6855 ios::iostate err = ios::goodbit;
6856 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6857 if ((err & ios::failbit) == 0) {
6860 checked_set(s, duration_cast<Duration>(seconds{tm.tm_sec}),
6869 int tI = not_a_hour_12_value;
6870 int tM = not_a_minute;
6871 read(is, ru{tI, 1, 2}, CharT{
':'}, ru{tM, 1, 2},
6872 CharT{
':'}, rld{S, 1, w});
6875 checked_set(s, round<Duration>(duration<long double> {S}),
6878 auto nm = detail::ampm_names();
6879 auto i = detail::scan_keyword(is, nm.first, nm.second) - nm.first;
6880 checked_set(p, static_cast<int>(i), not_a_ampm, is);
6884 read(is, CharT{
'%'}, width, modified, *fmt);
6895 if (modified == CharT{}) {
6896 int tH = not_a_hour;
6897 int tM = not_a_minute;
6898 read(is, ru{tH, 1, 2}, CharT{
'\0'}, CharT{
':'}, CharT{
'\0'},
6899 ru{tM, 1, 2}, CharT{
'\0'});
6904 read(is, CharT{
'%'}, width, modified, *fmt);
6916 if (modified == CharT {})
6918 if (modified != CharT {
'E'})
6924 read(is, rld{S, 1, width == -1 ? w :
static_cast<unsigned>(width)});
6925 checked_set(s, round<Duration>(duration<long double> {S}),
6929 else if (modified == CharT {
'O'}) {
6930 ios::iostate err = ios::goodbit;
6931 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6932 if ((err & ios::failbit) == 0)
6933 checked_set(s, duration_cast<Duration>(seconds{tm.tm_sec}),
6939 read(is, CharT{
'%'}, width, modified, *fmt);
6950 if (modified == CharT{}) {
6953 int tH = not_a_hour;
6954 int tM = not_a_minute;
6956 read(is, ru{tH, 1, 2}, CharT{
':'}, ru{tM, 1, 2},
6957 CharT{
':'}, rld{S, 1, w});
6960 checked_set(s, round<Duration>(duration<long double> {S}),
6964 read(is, CharT{
'%'}, width, modified, *fmt);
6976 if (modified == CharT {})
6978 if (modified != CharT {
'O'})
6981 int tY = not_a_year;
6982 read(is,
rs{tY, 1, width == -1 ? 4
u :
static_cast<unsigned>(width)});
6986 else if (modified == CharT {
'E'}) {
6987 ios::iostate err = ios::goodbit;
6988 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
6989 if ((err & ios::failbit) == 0) {
6990 checked_set(Y, tm.tm_year + 1900, not_a_year, is);
6996 read(is, CharT{
'%'}, width, modified, *fmt);
7008 if (modified == CharT {})
7011 int ty = not_a_2digit_year;
7012 read(is, ru{ty, 1, width == -1 ? 2
u :
static_cast<unsigned>(width)});
7017 ios::iostate err = ios::goodbit;
7018 f.get(is,
nullptr, is, err, &tm, command, fmt + 1);
7019 if ((err & ios::failbit) == 0) {
7020 checked_set(Y, tm.tm_year + 1900, not_a_year, is);
7035 if (modified == CharT{}) {
7036 int tg = not_a_2digit_year;
7037 read(is, ru{tg, 1, width == -1 ? 2
u :
static_cast<unsigned>(width)});
7041 read(is, CharT{
'%'}, width, modified, *fmt);
7052 if (modified == CharT{}) {
7053 int tG = not_a_year;
7054 read(is,
rs{tG, 1, width == -1 ? 4
u :
static_cast<unsigned>(width)});
7058 read(is, CharT{
'%'}, width, modified, *fmt);
7069 if (modified == CharT{}) {
7070 int tU = not_a_week_num;
7071 read(is, ru{tU, 1, width == -1 ? 2
u :
static_cast<unsigned>(width)});
7075 read(is, CharT{
'%'}, width, modified, *fmt);
7086 if (modified == CharT{}) {
7087 int tV = not_a_week_num;
7088 read(is, ru{tV, 1, width == -1 ? 2
u :
static_cast<unsigned>(width)});
7092 read(is, CharT{
'%'}, width, modified, *fmt);
7103 if (modified == CharT{}) {
7104 int tW = not_a_week_num;
7105 read(is, ru{tW, 1, width == -1 ? 2
u :
static_cast<unsigned>(width)});
7109 read(is, CharT{
'%'}, width, modified, *fmt);
7121 if (modified == CharT{}) {
7125 read(is, CharT{
'%'}, width, modified, *fmt);
7137 if (modified == CharT{})
7140 read(is, CharT{
'%'}, width, modified, *fmt);
7152 minutes toff = not_a_offset;
7154 auto ic = is.peek();
7155 if (!Traits::eq_int_type(ic, Traits::eof())) {
7156 auto c =
static_cast<char>(Traits::to_char_type(ic));
7161 if (modified == CharT{}) {
7167 if (!Traits::eq_int_type(ic, Traits::eof())) {
7168 auto c =
static_cast<char>(Traits::to_char_type(ic));
7169 if (
'0' <= c && c <=
'9') {
7170 read(is, ru{tM, 2, 2});
7172 toff += minutes{tM};
7183 if (!Traits::eq_int_type(ic, Traits::eof())) {
7184 auto c =
static_cast<char>(Traits::to_char_type(ic));
7187 read(is, ru{tM, 2, 2});
7189 toff += minutes{tM};
7208 if (modified == CharT{}) {
7209 std::basic_string<CharT, Traits, Alloc> buf;
7210 while (is.rdstate() == std::ios::goodbit) {
7211 auto i = is.rdbuf()->sgetc();
7212 if (Traits::eq_int_type(i, Traits::eof())) {
7213 is.setstate(ios::eofbit);
7216 auto wc = Traits::to_char_type(i);
7217 auto c =
static_cast<char>(wc);
7219 if (!(CharT{1} < wc && wc < CharT{127}) || !(isalnum(c) ||
7220 c ==
'_' || c ==
'/' || c ==
'-' || c ==
'+'))
7223 is.rdbuf()->sbumpc();
7226 is.setstate(ios::failbit);
7231 read(is, CharT{
'%'}, width, modified, *fmt);
7242 if (width == -1 && modified == CharT{} &&
'0' <= *fmt && *fmt <=
'9') {
7243 width =
static_cast<char>(*fmt) -
'0';
7244 while (
'0' <= fmt[1] && fmt[1] <=
'9') {
7245 width = 10 * width +
static_cast<char>(*++fmt) -
'0';
7249 if (modified == CharT{})
7250 read(is, CharT{
'%'}, width, *fmt);
7252 read(is, CharT{
'%'}, width, modified, *fmt);
7259 if (isspace(static_cast<unsigned char>(*fmt))) {
7273 if (is.rdstate() == ios::goodbit && command) {
7274 if (modified == CharT{})
7275 read(is, CharT{
'%'}, width);
7277 read(is, CharT{
'%'}, width, modified);
7280 if (y != not_a_2digit_year) {
7282 if (!(0 <= y && y <= 99)) {
7285 if (C == not_a_century) {
7286 if (Y == not_a_year) {
7295 C = (Y >= 0 ? Y : Y - 100) / 100;
7303 tY = 100 * (C + 1) - (y == 0 ? 100 : y);
7305 if (Y != not_a_year && Y != tY) {
7310 if (g != not_a_2digit_year) {
7312 if (!(0 <= g && g <= 99)) {
7315 if (C == not_a_century) {
7316 if (G == not_a_year) {
7325 C = (G >= 0 ? G : G - 100) / 100;
7333 tG = 100 * (C + 1) - (g == 0 ? 100 : g);
7335 if (G != not_a_year && G != tG) {
7343 bool computed =
false;
7344 if (G != not_a_year && V != not_a_week_num && wd != not_a_weekday) {
7348 if (Y == not_a_year) {
7349 Y =
static_cast<int>(ymd_trial.
year());
7351 else if (
year{Y} != ymd_trial.
year())
7353 if (m == not_a_month) {
7354 m =
static_cast<int>(
static_cast<unsigned>(ymd_trial.
month()));
7356 else if (
month(static_cast<unsigned>(m)) != ymd_trial.
month()) {
7359 if (d == not_a_day) {
7360 d =
static_cast<int>(
static_cast<unsigned>(ymd_trial.
day()));
7362 else if (
day(static_cast<unsigned>(d)) != ymd_trial.
day()) {
7367 if (Y != not_a_year && U != not_a_week_num && wd != not_a_weekday) {
7371 if (Y == not_a_year) {
7372 Y =
static_cast<int>(ymd_trial.
year());
7374 else if (
year{Y} != ymd_trial.
year())
7376 if (m == not_a_month) {
7377 m =
static_cast<int>(
static_cast<unsigned>(ymd_trial.
month()));
7379 else if (
month(static_cast<unsigned>(m)) != ymd_trial.
month()) {
7382 if (d == not_a_day) {
7383 d =
static_cast<int>(
static_cast<unsigned>(ymd_trial.
day()));
7385 else if (
day(static_cast<unsigned>(d)) != ymd_trial.
day()) {
7390 if (Y != not_a_year && W != not_a_week_num && wd != not_a_weekday) {
7394 if (Y == not_a_year) {
7395 Y =
static_cast<int>(ymd_trial.
year());
7397 else if (
year{Y} != ymd_trial.
year())
7399 if (m == not_a_month) {
7400 m =
static_cast<int>(
static_cast<unsigned>(ymd_trial.
month()));
7402 else if (
month(static_cast<unsigned>(m)) != ymd_trial.
month()) {
7405 if (d == not_a_day) {
7406 d =
static_cast<int>(
static_cast<unsigned>(ymd_trial.
day()));
7408 else if (
day(static_cast<unsigned>(d)) != ymd_trial.
day()) {
7413 if (j != not_a_doy && Y != not_a_year) {
7416 m =
static_cast<int>(
static_cast<unsigned>(ymd_trial.month()));
7418 else if (
month(static_cast<unsigned>(m)) != ymd_trial.
month()) {
7422 d =
static_cast<int>(
static_cast<unsigned>(ymd_trial.day()));
7424 else if (
day(static_cast<unsigned>(d)) != ymd_trial.
day()) {
7429 auto ymd =
year{Y} / m / d;
7431 if (wd == not_a_weekday) {
7438 if (G != not_a_year || V != not_a_week_num) {
7445 if (V != not_a_week_num)
7449 if (G != not_a_year && G != static_cast<int>(G_trial)) {
7452 if (V != not_a_week_num) {
7453 auto V_trial = duration_cast<
weeks>(sd - start).
count() + 1;
7459 if (U != not_a_week_num) {
7461 auto U_trial = floor<weeks>(
sys_days(ymd) - start).
count() + 1;
7466 if (W != not_a_week_num) {
7468 auto W_trial = floor<weeks>(
sys_days(ymd) - start).
count() + 1;
7476 if (I != not_a_hour_12_value) {
7477 if (!(1 <= I && I <= 12)) {
7480 if (p != not_a_ampm) {
7488 if (H == not_a_hour) {
7497 if (H != not_a_hour) {
7499 if (H != 0 && H != 12) {
7503 else if (!(I == H || I == H + 12)) {
7509 if (H != not_a_hour) {
7513 if (M != not_a_minute) {
7515 fds.
tod.m_ = minutes{M};
7517 if (s != not_a_second) {
7521 if (j != not_a_doy) {
7525 if (wd != not_a_weekday)
7526 fds.
wd =
weekday{
static_cast<unsigned>(wd)};
7527 if (abbrev !=
nullptr) {
7528 *abbrev = std::move(temp_abbrev);
7530 if (offset !=
nullptr && temp_offset != not_a_offset) {
7531 *offset = temp_offset;
7537 is.setstate(ios::failbit);
7541 template <
class CharT,
class Traits,
class Alloc = std::allocator<CharT>>
7542 std::basic_istream<CharT, Traits> &
7544 std::basic_string<CharT, Traits, Alloc> *abbrev =
nullptr,
7545 std::chrono::minutes *offset =
nullptr)
7547 using CT = std::chrono::seconds;
7550 if (!fds.ymd.year().ok()) {
7551 is.setstate(std::ios::failbit);
7559 template <
class CharT,
class Traits,
class Alloc = std::allocator<CharT>>
7560 std::basic_istream<CharT, Traits> &
7562 std::basic_string<CharT, Traits, Alloc> *abbrev =
nullptr,
7563 std::chrono::minutes *offset =
nullptr)
7565 using CT = std::chrono::seconds;
7568 if (!fds.ymd.month().ok()) {
7569 is.setstate(std::ios::failbit);
7572 m = fds.ymd.
month();
7577 template <
class CharT,
class Traits,
class Alloc = std::allocator<CharT>>
7578 std::basic_istream<CharT, Traits> &
7580 std::basic_string<CharT, Traits, Alloc> *abbrev =
nullptr,
7581 std::chrono::minutes *offset =
nullptr)
7583 using CT = std::chrono::seconds;
7586 if (!fds.ymd.day().ok()) {
7587 is.setstate(std::ios::failbit);
7595 template <
class CharT,
class Traits,
class Alloc = std::allocator<CharT>>
7596 std::basic_istream<CharT, Traits> &
7599 std::basic_string<CharT, Traits, Alloc> *abbrev =
nullptr,
7600 std::chrono::minutes *offset =
nullptr)
7602 using CT = std::chrono::seconds;
7606 is.setstate(std::ios::failbit);
7614 template <
class CharT,
class Traits,
class Alloc = std::allocator<CharT>>
7615 std::basic_istream<CharT, Traits> &
7618 std::basic_string<CharT, Traits, Alloc> *abbrev =
nullptr,
7619 std::chrono::minutes *offset =
nullptr)
7621 using CT = std::chrono::seconds;
7624 if (!fds.ymd.month().ok()) {
7625 is.setstate(std::ios::failbit);
7628 ym = fds.ymd.
year() / fds.ymd.month();
7633 template <
class CharT,
class Traits,
class Alloc = std::allocator<CharT>>
7634 std::basic_istream<CharT, Traits> &
7637 std::basic_string<CharT, Traits, Alloc> *abbrev =
nullptr,
7638 std::chrono::minutes *offset =
nullptr)
7640 using CT = std::chrono::seconds;
7643 if (!fds.ymd.month().ok() || !fds.ymd.day().ok()) {
7644 is.setstate(std::ios::failbit);
7647 md = fds.ymd.
month() / fds.ymd.day();
7652 template <
class CharT,
class Traits,
class Alloc = std::allocator<CharT>>
7653 std::basic_istream<CharT, Traits> &
7655 year_month_day &ymd, std::basic_string<CharT, Traits, Alloc> *abbrev =
nullptr,
7656 std::chrono::minutes *offset =
nullptr)
7658 using CT = std::chrono::seconds;
7661 if (!fds.ymd.ok()) {
7662 is.setstate(std::ios::failbit);
7670 template <
class Duration,
class CharT,
class Traits,
class Alloc = std::allocator<CharT>>
7671 std::basic_istream<CharT, Traits> &
7675 std::chrono::minutes *offset =
nullptr)
7677 using CT =
typename std::common_type<Duration, std::chrono::seconds>::type;
7678 std::chrono::minutes offset_local{};
7679 auto offptr = offset ? offset : &offset_local;
7683 if (!fds.ymd.ok() || !fds.tod.in_conventional_range()) {
7684 is.setstate(std::ios::failbit);
7687 tp = round<Duration>(
sys_days(fds.ymd) - *offptr + fds.tod.to_duration());
7692 template <
class Duration,
class CharT,
class Traits,
class Alloc = std::allocator<CharT>>
7693 std::basic_istream<CharT, Traits> &
7696 std::basic_string<CharT, Traits, Alloc> *abbrev =
nullptr,
7697 std::chrono::minutes *offset =
nullptr)
7699 using CT =
typename std::common_type<Duration, std::chrono::seconds>::type;
7703 if (!fds.ymd.ok() || !fds.tod.in_conventional_range()) {
7704 is.setstate(std::ios::failbit);
7708 fds.tod.to_duration());
7712 template <
class Rep,
class Period,
class CharT,
class Traits,
class Alloc = std::allocator<CharT>>
7713 std::basic_istream<CharT, Traits> &
7715 std::chrono::duration<Rep, Period> &d,
7716 std::basic_string<CharT, Traits, Alloc> *abbrev =
nullptr,
7717 std::chrono::minutes *offset =
nullptr)
7719 using Duration = std::chrono::duration<Rep, Period>;
7720 using CT =
typename std::common_type<Duration, std::chrono::seconds>::type;
7724 is.setstate(std::ios::failbit);
7727 d = std::chrono::duration_cast<Duration>(fds.tod.to_duration());
7732 template <
class Parsable,
class CharT,
class Traits = std::
char_traits<CharT>,
7733 class Alloc = std::allocator<CharT>>
7734 struct parse_manip {
7735 const std::basic_string<CharT, Traits, Alloc> format_;
7737 std::basic_string<CharT, Traits, Alloc> *abbrev_;
7738 std::chrono::minutes *offset_;
7741 parse_manip(std::basic_string<CharT, Traits, Alloc>
format, Parsable &tp,
7742 std::basic_string<CharT, Traits, Alloc> *abbrev =
nullptr,
7743 std::chrono::minutes *offset =
nullptr)
7744 : format_(std::move(format))
7752 template <
class Parsable,
class CharT,
class Traits,
class Alloc>
7753 std::basic_istream<CharT, Traits> &
7755 const parse_manip<Parsable, CharT, Traits, Alloc> &x)
7757 return from_stream(is, x.format_.c_str(), x.tp_, x.abbrev_, x.offset_);
7760 template <
class Parsable,
class CharT,
class Traits,
class Alloc>
7763 parse(
const std::basic_string<CharT, Traits, Alloc> &
format, Parsable &tp)
7764 -> decltype(
from_stream(std::declval<std::basic_istream<CharT, Traits>&>(),
7765 format.c_str(), tp),
7766 parse_manip<Parsable, CharT, Traits, Alloc>
7774 template <
class Parsable,
class CharT,
class Traits,
class Alloc>
7777 parse(
const std::basic_string<CharT, Traits, Alloc> &format, Parsable &tp,
7778 std::basic_string<CharT, Traits, Alloc> &abbrev)
7779 -> decltype(
from_stream(std::declval<std::basic_istream<CharT, Traits>&>(),
7780 format.c_str(), tp, &abbrev),
7781 parse_manip<Parsable, CharT, Traits, Alloc>
7786 return {
format, tp, &abbrev};
7789 template <
class Parsable,
class CharT,
class Traits,
class Alloc>
7792 parse(
const std::basic_string<CharT, Traits, Alloc> &format, Parsable &tp,
7793 std::chrono::minutes &offset)
7794 -> decltype(
from_stream(std::declval<std::basic_istream<CharT, Traits>&>(),
7796 std::declval<std::basic_string<CharT, Traits, Alloc>*>(),
7798 parse_manip<Parsable, CharT, Traits, Alloc>
7800 format, tp,
nullptr, &offset
7803 return {
format, tp,
nullptr, &offset};
7806 template <
class Parsable,
class CharT,
class Traits,
class Alloc>
7809 parse(
const std::basic_string<CharT, Traits, Alloc> &format, Parsable &tp,
7810 std::basic_string<CharT, Traits, Alloc> &abbrev, std::chrono::minutes &offset)
7811 -> decltype(
from_stream(std::declval<std::basic_istream<CharT, Traits>&>(),
7812 format.c_str(), tp, &abbrev, &offset),
7813 parse_manip<Parsable, CharT, Traits, Alloc>
7815 format, tp, &abbrev, &offset
7818 return {
format, tp, &abbrev, &offset};
7823 template <
class Parsable,
class CharT>
7826 parse(
const CharT *format, Parsable &tp)
7827 -> decltype(
from_stream(std::declval<std::basic_istream<CharT>&>(), format, tp),
7828 parse_manip<Parsable, CharT>
7836 template <
class Parsable,
class CharT,
class Traits,
class Alloc>
7839 parse(
const CharT *format, Parsable &tp,
7840 std::basic_string<CharT, Traits, Alloc> &abbrev)
7841 -> decltype(
from_stream(std::declval<std::basic_istream<CharT, Traits>&>(),
7844 parse_manip<Parsable, CharT, Traits, Alloc>
7849 return {
format, tp, &abbrev};
7852 template <
class Parsable,
class CharT>
7855 parse(
const CharT *format, Parsable &tp, std::chrono::minutes &offset)
7856 -> decltype(
from_stream(std::declval<std::basic_istream<CharT>&>(), format,
7857 tp, std::declval<std::basic_string<CharT>*>(), &offset),
7858 parse_manip<Parsable, CharT>
7860 format, tp,
nullptr, &offset
7863 return {
format, tp,
nullptr, &offset};
7866 template <
class Parsable,
class CharT,
class Traits,
class Alloc>
7869 parse(
const CharT *format, Parsable &tp,
7870 std::basic_string<CharT, Traits, Alloc> &abbrev, std::chrono::minutes &offset)
7871 -> decltype(
from_stream(std::declval<std::basic_istream<CharT, Traits>&>(),
7873 tp, &abbrev, &offset),
7874 parse_manip<Parsable, CharT, Traits, Alloc>
7876 format, tp, &abbrev, &offset
7879 return {
format, tp, &abbrev, &offset};
7884 template <
class CharT,
class Traits,
class Rep,
class Period>
7886 std::basic_ostream<CharT, Traits> &
7887 operator<<(std::basic_ostream<CharT, Traits> &os,
7888 const std::chrono::duration<Rep, Period> &d)
7890 return os << detail::make_string<CharT, Traits>::from(d.count()) +
7891 detail::get_units<CharT>(
typename Period::type{});
7897 # pragma warning(pop) 7901 # pragma GCC diagnostic pop CONSTCD14 bool ok() const NOEXCEPT
Definition: date.h:2241
CONSTCD11 bool ok() const NOEXCEPT
Definition: date.h:2017
unsigned read_unsigned(std::basic_istream< CharT, Traits > &is, unsigned m=1, unsigned M=10)
Definition: date.h:6000
CONSTCD11 bool ok() const NOEXCEPT
Definition: date.h:2448
int r
Definition: decode_rs.h:71
data_t t[NROOTS+1]
Definition: decode_rs.h:77
long double & i
Definition: date.h:6105
int i
Definition: decode_rs.h:71
CONSTCD11 bool is_leap() const NOEXCEPT
Definition: date.h:1632
CONSTCD14 bool ok() const NOEXCEPT
Definition: date.h:2795
unsigned m
Definition: date.h:6100
CONSTDATA date::weekday Sunday
Definition: date.h:1933
CONSTDATA date::weekday sun
Definition: date.h:1902
CONSTDATA date::weekday Monday
Definition: date.h:1927
CONSTDATA date::weekday tue
Definition: date.h:1904
CONSTCD14 bool is_am(std::chrono::hours const &h) NOEXCEPT
Definition: date.h:3893
CONSTCD11 bool ok() const NOEXCEPT
Definition: date.h:2394
CONSTCD11 year_month_day_last(const date::year &y, const date::month_day_last &mdl) NOEXCEPT
Definition: date.h:2480
CONSTCD11 bool operator==(const day &x, const day &y) NOEXCEPT
Definition: date.h:1403
typename dfs::precision precision
Definition: date.h:3803
int j
Definition: decode_rs.h:71
Definition: rs-common.h:7
unsigned M
Definition: date.h:6095
CONSTDATA date::month mar
Definition: date.h:1891
CONSTDATA date::month dec
Definition: date.h:1900
CONSTCD11 bool ok() const NOEXCEPT
Definition: date.h:1789
local_time< days > local_days
Definition: date.h:191
rs
Definition: init_rs.h:11
CONSTCD14 year_month_day_last & operator+=(const months &m) NOEXCEPT
Definition: date.h:2491
CharT fill_
Definition: date.h:1043
CONSTCD14 year & operator--() NOEXCEPT
Definition: date.h:1616
CONSTCD11 std::chrono::time_point< Clock, To > floor(const std::chrono::time_point< Clock, FromDuration > &tp)
Definition: date.h:1333
CONSTCD14 year & operator-=(const years &y) NOEXCEPT
Definition: date.h:1619
CONSTDATA date::weekday Friday
Definition: date.h:1931
std::chrono::duration< int, std::ratio_multiply< std::ratio< 146097, 400 >, days::period >::type > years
Definition: date.h:172
CONSTCD11 unsigned index() const NOEXCEPT
Definition: date.h:3014
#define NOEXCEPT
Definition: date.h:135
int count
Definition: decode_rs.h:79
std::ratio< mul< n1, d2, !value >::value, mul< n2, d1, !value >::value > type
Definition: date.h:1199
CONSTCD11 year operator+() const NOEXCEPT
Definition: date.h:1624
CONSTCD14 date::day day() const NOEXCEPT
Definition: date.h:2541
CONSTDATA date::month apr
Definition: date.h:1892
sys_time< std::chrono::seconds > sys_seconds
Definition: date.h:183
CONSTCD14 weekday & operator+=(const days &d) NOEXCEPT
Definition: date.h:1776
CONSTCD11 date::year year() const NOEXCEPT
Definition: date.h:2521
year_month_day ymd
Definition: date.h:4533
std::basic_istream< CharT, Traits > & operator>>(std::basic_istream< CharT, Traits > &is, const parse_manip< Parsable, CharT, Traits, Alloc > &x)
Definition: date.h:7754
CONSTDATA date::month December
Definition: date.h:1925
CONSTCD11 day operator-(const day &x, const days &y) NOEXCEPT
Definition: date.h:1468
CONSTDATA date::month sep
Definition: date.h:1897
CONSTCD11 date::month month() const NOEXCEPT
Definition: date.h:2716
CONSTCD14 year_month_weekday_last & operator-=(const months &m) NOEXCEPT
Definition: date.h:3174
CONSTDATA date::month March
Definition: date.h:1916
std::chrono::duration< int, std::ratio_multiply< std::ratio< 7 >, days::period >::type > weeks
Definition: date.h:169
CONSTCD11 std::enable_if< !std::numeric_limits< Rep >::is_signed, std::chrono::duration< Rep, Period > >::type abs(std::chrono::duration< Rep, Period > d)
Definition: date.h:3784
CONSTCD11 bool in_conventional_range() const NOEXCEPT
Definition: date.h:3850
void read(std::basic_istream< CharT, Traits > &)
Definition: date.h:6112
CONSTDATA date::month September
Definition: date.h:1922
CONSTCD11 date::year year() const NOEXCEPT
Definition: date.h:2712
CONSTCD11 hh_mm_ss() NOEXCEPT
Definition: date.h:3805
CONSTCD11 bool ok() const NOEXCEPT
Definition: date.h:2310
CONSTDATA date::weekday Saturday
Definition: date.h:1932
CONSTCD14 To ceil(const std::chrono::duration< Rep, Period > &d)
Definition: date.h:1308
fields(weekday wd_, hh_mm_ss< Duration > tod_)
Definition: date.h:4548
std::basic_istream< CharT, Traits > & from_stream(std::basic_istream< CharT, Traits > &is, const CharT *fmt, fields< Duration > &fds, std::basic_string< CharT, Traits, Alloc > *abbrev=nullptr, std::chrono::minutes *offset=nullptr)
Definition: date.h:6234
CONSTCD11 date::month_day_last month_day_last() const NOEXCEPT
Definition: date.h:2533
CONSTDATA date::weekday sat
Definition: date.h:1908
save_istream(std::basic_ios< CharT, Traits > &is)
Definition: date.h:1062
CONSTCD11 date::weekday_last weekday_last() const NOEXCEPT
Definition: date.h:3215
int & i
Definition: date.h:6099
void read(std::basic_istream< CharT, Traits > &is, rld a0, Args &&...args)
Definition: date.h:6205
unsigned m
Definition: date.h:6106
CONSTCD14 day & operator++() NOEXCEPT
Definition: date.h:1385
#define HAS_UNCAUGHT_EXCEPTIONS
Definition: date.h:142
CONSTDATA date::month January
Definition: date.h:1914
CONSTCD11 date::month month() const NOEXCEPT
Definition: date.h:2378
CONSTCD11 precision subseconds() const NOEXCEPT
Definition: date.h:3832
sys_time< days > sys_days
Definition: date.h:182
CONSTCD11 bool ok() const NOEXCEPT
Definition: date.h:1645
CONSTCD11 date::weekday weekday() const NOEXCEPT
Definition: date.h:3207
CONSTCD11 bool operator>(const day &x, const day &y) NOEXCEPT
Definition: date.h:1424
CONSTDATA date::month feb
Definition: date.h:1890
CONSTCD11 date::month month() const NOEXCEPT
Definition: date.h:2229
std::streamsize width_
Definition: date.h:1045
auto format(const std::locale &loc, const CharT *fmt, const Streamable &tp) -> decltype(to_stream(std::declval< std::basic_ostream< CharT > &>(), fmt, tp), std::basic_string< CharT >
Definition: date.h:5927
static CONSTCD11 year min() NOEXCEPT
Definition: date.h:416
CONSTCD11 year_month operator/(const year &y, const month &m) NOEXCEPT
Definition: date.h:3328
CONSTDATA date::weekday Wednesday
Definition: date.h:1929
CONSTCD11 hh_mm_ss< std::chrono::duration< Rep, Period > > make_time(const std::chrono::duration< Rep, Period > &d)
Definition: date.h:3948
CONSTCD11 date::weekday_last weekday_last() const NOEXCEPT
Definition: date.h:2440
CONSTDATA date::month August
Definition: date.h:1921
CONSTCD11 std::chrono::time_point< Clock, To > ceil(const std::chrono::time_point< Clock, FromDuration > &tp)
Definition: date.h:1355
CONSTCD11 date::weekday weekday() const NOEXCEPT
Definition: date.h:2013
CONSTCD11 date::weekday_indexed weekday_indexed() const NOEXCEPT
Definition: date.h:3022
CONSTCD11 std::chrono::duration< Rep, Period > abs(std::chrono::duration< Rep, Period > d)
Definition: date.h:1323
CONSTCD11 date::year year() const NOEXCEPT
Definition: date.h:3195
int read_signed(std::basic_istream< CharT, Traits > &is, unsigned m=1, unsigned M=10)
Definition: date.h:6029
fields(year_month_day ymd_, weekday wd_, hh_mm_ss< Duration > tod_)
Definition: date.h:4551
CONSTCD11 bool ok() const NOEXCEPT
Definition: date.h:1517
CONSTDATA date::month February
Definition: date.h:1915
CONSTCD14 weekday & operator++() NOEXCEPT
Definition: date.h:1768
CONSTCD14 std::chrono::hours make24(std::chrono::hours h, bool is_pm) NOEXCEPT
Definition: date.h:3927
save_ostream(std::basic_ios< CharT, Traits > &os)
Definition: date.h:1096
CONSTCD11 bool ok() const NOEXCEPT
Definition: date.h:3237
CONSTCD11 date::weekday_indexed weekday_indexed() const NOEXCEPT
Definition: date.h:2386
CONSTCD11 std::chrono::minutes minutes() const NOEXCEPT
Definition: date.h:3822
CONSTCD11 bool ok() const NOEXCEPT
Definition: date.h:2072
fields(year_month_day ymd_)
Definition: date.h:4540
CONSTDATA date::month jun
Definition: date.h:1894
CONSTCD11 year operator-() const NOEXCEPT
Definition: date.h:1620
CONSTDATA date::month oct
Definition: date.h:1898
std::ios::fmtflags flags_
Definition: date.h:1044
CONSTCD11 weekday_indexed operator[](unsigned index) const NOEXCEPT
Definition: date.h:1992
CONSTDATA date::month jan
Definition: date.h:1889
CONSTCD14 year & operator+=(const years &y) NOEXCEPT
Definition: date.h:1618
fields(year_month_day ymd_, hh_mm_ss< Duration > tod_)
Definition: date.h:4545
CONSTDATA date::weekday wed
Definition: date.h:1905
CONSTCD11 std::enable_if< std::numeric_limits< Rep >::is_signed, std::chrono::duration< Rep, Period > >::type abs(std::chrono::duration< Rep, Period > d)
Definition: date.h:3771
CONSTCD14 year_month_day_last & operator-=(const months &m) NOEXCEPT
Definition: date.h:2500
CONSTCD11 day operator+(const day &x, const days &y) NOEXCEPT
Definition: date.h:1454
CONSTDATA date::month July
Definition: date.h:1920
#define CONSTDATA
Definition: date.h:132
CONSTCD11 bool ok() const NOEXCEPT
Definition: date.h:1395
fields(year_month_day ymd_, weekday wd_)
Definition: date.h:4544
CONSTDATA date::weekday mon
Definition: date.h:1903
CONSTCD11 weekday_last(const date::weekday &wd) NOEXCEPT
Definition: date.h:2021
std::chrono::duration< int, std::ratio_divide< years::period, std::ratio< 12 > >::type > months
Definition: date.h:175
CONSTCD14 year & operator++() NOEXCEPT
Definition: date.h:1614
CONSTCD14 To round(const std::chrono::duration< Rep, Period > &d)
Definition: date.h:1284
CONSTCD11 std::chrono::time_point< Clock, To > round(const std::chrono::time_point< Clock, FromDuration > &tp)
Definition: date.h:1344
CONSTCD11 date::weekday weekday() const NOEXCEPT
Definition: date.h:3006
std::basic_ostream< CharT, Traits > & to_stream(std::basic_ostream< CharT, Traits > &os, const CharT *fmt, const fields< Duration > &fds, const std::string *abbrev=nullptr, const std::chrono::seconds *offset_sec=nullptr)
Definition: date.h:4772
CONSTCD11 bool operator>=(const day &x, const day &y) NOEXCEPT
Definition: date.h:1438
typename std::conditional< digits< 32, std::int32_t, typename std::conditional< digits< 64, std::int64_t, std::int64_t >::type >::type type
Definition: date.h:1119
CONSTCD14 bool is_pm(std::chrono::hours const &h) NOEXCEPT
Definition: date.h:3901
data_t tmp
Definition: decode_rs.h:74
CONSTDATA date::weekday Tuesday
Definition: date.h:1928
CONSTCD14 year_month_weekday & operator-=(const months &m) NOEXCEPT
Definition: date.h:2973
static CONSTCD11 year max() NOEXCEPT
Definition: date.h:417
unsigned M
Definition: date.h:6107
CONSTCD11 year_month_weekday_last(const date::year &y, const date::month &m, const date::weekday_last &wdl) NOEXCEPT
Definition: date.h:3152
CONSTCD11 date::year year() const NOEXCEPT
Definition: date.h:2064
CONSTDATA date::weekday fri
Definition: date.h:1907
CONSTDATA date::month May
Definition: date.h:1918
CONSTCD14 month & operator--() NOEXCEPT
Definition: date.h:1494
CONSTCD14 year_month_day & operator+=(const months &m) NOEXCEPT
Definition: date.h:2729
std::chrono::time_point< std::chrono::system_clock, Duration > sys_time
Definition: date.h:180
CONSTCD11 bool operator!=(const day &x, const day &y) NOEXCEPT
Definition: date.h:1410
CONSTCD11 date::month month() const NOEXCEPT
Definition: date.h:2068
bool has_tod
Definition: date.h:4536
CONSTCD14 day & operator+=(const days &d) NOEXCEPT
Definition: date.h:1389
CONSTDATA date::month November
Definition: date.h:1924
CONSTCD14 std::enable_if< detail::no_overflow< Period, typename To::period >::value, To >::type floor(const std::chrono::duration< Rep, Period > &d)
Definition: date.h:1257
CONSTCD14 month & operator++() NOEXCEPT
Definition: date.h:1492
CONSTCD14 std::chrono::seconds & seconds(detail::undocumented) NOEXCEPT
Definition: date.h:3831
#define CONSTCD14
Definition: date.h:134
CONSTCD14 day & operator--() NOEXCEPT
Definition: date.h:1387
CONSTDATA date::weekday thu
Definition: date.h:1906
CONSTCD11 std::chrono::seconds seconds() const NOEXCEPT
Definition: date.h:3826
CONSTCD11 date::month month() const NOEXCEPT
Definition: date.h:2432
CONSTDATA date::last_spec last
Definition: date.h:1887
CONSTCD11 date::day day() const NOEXCEPT
Definition: date.h:2720
CONSTCD14 year_month & operator+=(const months &dm) NOEXCEPT
Definition: date.h:2081
std::basic_ostream< CharT, Traits > * tie_
Definition: date.h:1046
weekday wd
Definition: date.h:4534
CONSTDATA date::month October
Definition: date.h:1923
CONSTCD11 std::enable_if<!std::chrono::treat_as_floating_point< T >::value, T >::type trunc(T t) NOEXCEPT
Definition: date.h:1130
~save_istream()
Definition: date.h:1050
fields(hh_mm_ss< Duration > tod_)
Definition: date.h:4542
CONSTCD11 unsigned index() const NOEXCEPT
Definition: date.h:1945
data_t loc[NROOTS]
Definition: decode_rs.h:78
CONSTCD14 std::chrono::hours make12(std::chrono::hours h) NOEXCEPT
Definition: date.h:3909
long double read_long_double(std::basic_istream< CharT, Traits > &is, unsigned m=1, unsigned M=10)
Definition: date.h:6056
fields(weekday wd_)
Definition: date.h:4541
local_time< std::chrono::seconds > local_seconds
Definition: date.h:190
CONSTDATA year nanyear
Definition: date.h:4529
weekday_indexed()=default
CONSTCD11 std::chrono::hours hours() const NOEXCEPT
Definition: date.h:3818
CONSTCD11 date::weekday weekday() const NOEXCEPT
Definition: date.h:1940
CONSTDATA date::month June
Definition: date.h:1919
CONSTCD14 weekday & operator--() NOEXCEPT
Definition: date.h:1770
CONSTCD11 month_day_last(const date::month &m) NOEXCEPT
Definition: date.h:2314
std::chrono::duration< int, std::ratio_multiply< std::ratio< 24 >, std::chrono::hours::period >::type > days
Definition: date.h:166
CONSTCD11 bool ok() const NOEXCEPT
Definition: date.h:2570
CONSTCD11 date::day day() const NOEXCEPT
Definition: date.h:2233
CONSTCD11 hh_mm_ss(Duration d) NOEXCEPT
Definition: date.h:3810
unsigned m
Definition: date.h:6094
CONSTCD14 month & operator+=(const months &m) NOEXCEPT
Definition: date.h:1500
~save_ostream()
Definition: date.h:1080
CONSTCD14 year_month & operator-=(const months &dm) NOEXCEPT
Definition: date.h:2090
std::locale loc_
Definition: date.h:1047
unsigned extract_month(std::basic_ostream< CharT, Traits > &os, const fields< Duration > &fds)
Definition: date.h:4588
data_t den
Definition: decode_rs.h:74
year_month_weekday()=default
CONSTDATA date::weekday Thursday
Definition: date.h:1930
CONSTCD14 bool ok() const NOEXCEPT
Definition: date.h:3044
CONSTCD14 month & operator-=(const months &m) NOEXCEPT
Definition: date.h:1508
CONSTDATA date::month jul
Definition: date.h:1895
bool read_char(std::basic_istream< CharT, Traits > &is, CharT fmt, std::ios::iostate &err)
Definition: date.h:5985
CONSTCD11 date::month month() const NOEXCEPT
Definition: date.h:2525
unsigned extract_weekday(std::basic_ostream< CharT, Traits > &os, const fields< Duration > &fds)
Definition: date.h:4563
std::basic_ios< CharT, Traits > & is_
Definition: date.h:1042
CONSTDATA date::month may
Definition: date.h:1893
void checked_set(T &value, T from, T not_a_value, std::basic_ios< CharT, Traits > &is)
Definition: date.h:6218
CONSTCD11 std::enable_if< detail::no_overflow< Period, typename To::period >::value, To >::type trunc(const std::chrono::duration< Rep, Period > &d)
Definition: date.h:1213
data_t u
Definition: decode_rs.h:74
unsigned M
Definition: date.h:6101
CONSTCD11 bool operator<(const day &x, const day &y) NOEXCEPT
Definition: date.h:1417
std::chrono::time_point< local_t, Duration > local_time
Definition: date.h:188
CONSTDATA date::month aug
Definition: date.h:1896
CONSTCD14 day & operator-=(const days &d) NOEXCEPT
Definition: date.h:1390
CONSTCD11 date::month month() const NOEXCEPT
Definition: date.h:2306
CONSTCD11 unsigned c_encoding() const NOEXCEPT
Definition: date.h:1796
CONSTCD14 weekday & operator-=(const days &d) NOEXCEPT
Definition: date.h:1784
int & i
Definition: date.h:6093
CONSTCD11 month_weekday(const date::month &m, const date::weekday_indexed &wdi) NOEXCEPT
Definition: date.h:2371
CONSTCD11 unsigned iso_encoding() const NOEXCEPT
Definition: date.h:1803
hh_mm_ss< Duration > tod
Definition: date.h:4535
CONSTDATA date::month April
Definition: date.h:1917
data_t s[NROOTS]
Definition: decode_rs.h:75
CONSTCD11 bool is_negative() const NOEXCEPT
Definition: date.h:3836
CONSTCD14 year_month_weekday_last & operator+=(const months &m) NOEXCEPT
Definition: date.h:3165
CONSTCD11 bool ok() const NOEXCEPT
Definition: date.h:1953
CONSTDATA date::month nov
Definition: date.h:1899
CONSTCD11 precision to_duration() const NOEXCEPT
Definition: date.h:3845
CONSTCD11 date::month month() const NOEXCEPT
Definition: date.h:2998
CONSTCD14 year_month_day & operator-=(const months &m) NOEXCEPT
Definition: date.h:2738
CONSTCD11 month_weekday_last(const date::month &m, const date::weekday_last &wd) NOEXCEPT
Definition: date.h:2425
CONSTCD11 date::month month() const NOEXCEPT
Definition: date.h:3199
CONSTCD11 date::year year() const NOEXCEPT
Definition: date.h:2994
CONSTCD14 year_month_weekday & operator+=(const months &m) NOEXCEPT
Definition: date.h:2964
CONSTCD11 bool operator<=(const day &x, const day &y) NOEXCEPT
Definition: date.h:1431
#define CONSTCD11
Definition: date.h:133