Update date.h (#518)

using decltype in day constructor to be consistent with month and year
This commit is contained in:
johnmph
2019-12-05 20:00:16 +01:00
committed by Howard Hinnant
parent 4c95165298
commit 48433b9892

View File

@@ -1367,7 +1367,7 @@ trunc(const std::chrono::time_point<Clock, FromDuration>& tp)
// day
CONSTCD11 inline day::day(unsigned d) NOEXCEPT : d_(static_cast<unsigned char>(d)) {}
CONSTCD11 inline day::day(unsigned d) NOEXCEPT : d_(static_cast<decltype(d_)>(d)) {}
CONSTCD14 inline day& day::operator++() NOEXCEPT {++d_; return *this;}
CONSTCD14 inline day day::operator++(int) NOEXCEPT {auto tmp(*this); ++(*this); return tmp;}
CONSTCD14 inline day& day::operator--() NOEXCEPT {--d_; return *this;}