@@ -420,14 +420,11 @@ auto write(OutputIt out, const std::tm& time, const std::locale& loc,
420420 return write_encoded_tm_str (out, string_view (buf.data (), buf.size ()), loc);
421421}
422422
423- template <typename Rep1, typename Rep2>
424- struct is_same_arithmetic_type
425- : public std::integral_constant<bool ,
426- (std::is_integral<Rep1>::value &&
427- std::is_integral<Rep2>::value) ||
428- (std::is_floating_point<Rep1>::value &&
429- std::is_floating_point<Rep2>::value)> {
430- };
423+ template <typename T, typename U>
424+ using is_similar_arithmetic_type =
425+ bool_constant<(std::is_integral<T>::value && std::is_integral<U>::value) ||
426+ (std::is_floating_point<T>::value &&
427+ std::is_floating_point<U>::value)>;
431428
432429FMT_NORETURN inline void throw_duration_error () {
433430 FMT_THROW (format_error (" cannot format duration" ));
@@ -486,9 +483,9 @@ auto duration_cast(std::chrono::duration<FromRep, FromPeriod> from) -> To {
486483#endif
487484}
488485
489- template <
490- typename To, typename FromRep, typename FromPeriod,
491- FMT_ENABLE_IF (!is_same_arithmetic_type <FromRep, typename To::rep>::value)>
486+ template <typename To, typename FromRep, typename FromPeriod,
487+ FMT_ENABLE_IF (
488+ !is_similar_arithmetic_type <FromRep, typename To::rep>::value)>
492489auto duration_cast (std::chrono::duration<FromRep, FromPeriod> from) -> To {
493490 // Mixed integer <-> float cast is not supported by safe_duration_cast.
494491 return std::chrono::duration_cast<To>(from);
@@ -520,6 +517,7 @@ template <typename... T> auto current_zone(T...) -> time_zone* {
520517template <typename ... T> void _tzset (T...) {}
521518} // namespace tz
522519
520+ // DEPRECATED!
523521inline void tzset_once () {
524522 static bool init = []() {
525523 using namespace tz ;
@@ -2227,8 +2225,10 @@ template <typename Char> struct formatter<std::tm, Char> {
22272225 ctx.out (), basic_string_view<Char>(buf.data (), buf.size ()), specs);
22282226 }
22292227
2230- FMT_CONSTEXPR auto do_parse (parse_context<Char>& ctx,
2231- bool no_timezone = false ) -> const Char* {
2228+ FMT_CONSTEXPR auto do_parse (
2229+ parse_context<Char>& ctx,
2230+ bool no_timezone = !detail::has_member_data_tm_gmtoff<std::tm>::value)
2231+ -> const Char* {
22322232 auto it = ctx.begin (), end = ctx.end ();
22332233 if (it == end || *it == ' }' ) return it;
22342234
0 commit comments