mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-01 03:34:26 +02:00
Work around a compiler bug in VS2013 with explicit conversion constructors.
This commit is contained in:
committed by
Howard Hinnant
parent
570a1e699c
commit
553affefa4
2
date.h
2
date.h
@@ -2769,7 +2769,7 @@ year_month_weekday::ok() const NOEXCEPT
|
||||
return false;
|
||||
if (wdi_.index() <= 4)
|
||||
return true;
|
||||
auto d2 = wdi_.weekday() - date::weekday(y_/m_/1) + days((wdi_.index()-1)*7 + 1);
|
||||
auto d2 = wdi_.weekday() - date::weekday(static_cast<sys_days>(y_/m_/1)) + days((wdi_.index()-1)*7 + 1);
|
||||
return static_cast<unsigned>(d2.count()) <= static_cast<unsigned>((y_/m_/last).day());
|
||||
}
|
||||
|
||||
|
8
tz.cpp
8
tz.cpp
@@ -926,7 +926,7 @@ MonthDayTime::to_sys_days(date::year y) const
|
||||
case lteq:
|
||||
{
|
||||
auto const x = y/u.month_day_weekday_.month_day_;
|
||||
auto const wd1 = weekday(x);
|
||||
auto const wd1 = weekday(static_cast<sys_days>(x));
|
||||
auto const wd0 = u.month_day_weekday_.weekday_;
|
||||
return sys_days(x) - (wd1-wd0);
|
||||
}
|
||||
@@ -935,7 +935,7 @@ MonthDayTime::to_sys_days(date::year y) const
|
||||
}
|
||||
auto const x = y/u.month_day_weekday_.month_day_;
|
||||
auto const wd1 = u.month_day_weekday_.weekday_;
|
||||
auto const wd0 = weekday(x);
|
||||
auto const wd0 = weekday(static_cast<sys_days>(x));
|
||||
return sys_days(x) + (wd1-wd0);
|
||||
}
|
||||
|
||||
@@ -965,7 +965,7 @@ MonthDayTime::canonicalize(date::year y)
|
||||
case lteq:
|
||||
{
|
||||
auto const x = y/u.month_day_weekday_.month_day_;
|
||||
auto const wd1 = weekday(x);
|
||||
auto const wd1 = weekday(static_cast<sys_days>(x));
|
||||
auto const wd0 = u.month_day_weekday_.weekday_;
|
||||
auto const ymd = year_month_day(sys_days(x) - (wd1-wd0));
|
||||
u.month_day_ = ymd.month()/ymd.day();
|
||||
@@ -976,7 +976,7 @@ MonthDayTime::canonicalize(date::year y)
|
||||
{
|
||||
auto const x = y/u.month_day_weekday_.month_day_;
|
||||
auto const wd1 = u.month_day_weekday_.weekday_;
|
||||
auto const wd0 = weekday(x);
|
||||
auto const wd0 = weekday(static_cast<sys_days>(x));
|
||||
auto const ymd = year_month_day(sys_days(x) + (wd1-wd0));
|
||||
u.month_day_ = ymd.month()/ymd.day();
|
||||
type_ = month_day;
|
||||
|
Reference in New Issue
Block a user