Skip to content

Commit df17909

Browse files
committed
Remove fmt_detail
1 parent 5f6fb96 commit df17909

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

include/fmt/chrono.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,6 @@
2222

2323
#include "format.h"
2424

25-
namespace fmt_detail {
26-
struct time_zone {
27-
template <typename Duration, typename T>
28-
auto to_sys(T)
29-
-> std::chrono::time_point<std::chrono::system_clock, Duration> {
30-
return {};
31-
}
32-
};
33-
template <typename... T> inline auto current_zone(T...) -> time_zone* {
34-
return nullptr;
35-
}
36-
37-
template <typename... T> inline void _tzset(T...) {}
38-
} // namespace fmt_detail
39-
4025
FMT_BEGIN_NAMESPACE
4126

4227
// Enable safe chrono durations, unless explicitly disabled.
@@ -519,12 +504,27 @@ auto to_time_t(sys_time<Duration> time_point) -> std::time_t {
519504
.count();
520505
}
521506

507+
namespace tz {
508+
struct time_zone {
509+
template <typename Duration, typename T>
510+
auto to_sys(T)
511+
-> std::chrono::time_point<std::chrono::system_clock, Duration> {
512+
return {};
513+
}
514+
};
515+
template <typename... T> inline auto current_zone(T...) -> time_zone* {
516+
return nullptr;
517+
}
518+
519+
template <typename... T> inline void _tzset(T...) {}
520+
} // namespace tz
521+
522522
// Workaround a bug in libstdc++ which sets __cpp_lib_chrono to 201907 without
523523
// providing current_zone(): https://github.com/fmtlib/fmt/issues/4160.
524524
template <typename T> FMT_CONSTEXPR auto has_current_zone() -> bool {
525525
using namespace std::chrono;
526-
using namespace fmt_detail;
527-
return !std::is_same<decltype(current_zone()), fmt_detail::time_zone*>::value;
526+
using namespace tz;
527+
return !std::is_same<decltype(current_zone()), tz::time_zone*>::value;
528528
}
529529
} // namespace detail
530530

@@ -1005,7 +1005,7 @@ struct has_member_data_tm_zone<T, void_t<decltype(T::tm_zone)>>
10051005

10061006
inline void tzset_once() {
10071007
static bool init = []() {
1008-
using namespace fmt_detail;
1008+
using namespace tz;
10091009
_tzset();
10101010
return false;
10111011
}();

0 commit comments

Comments
 (0)