diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 50c777c841aa..5a56da52808d 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -22,6 +22,8 @@ #include "format.h" +FMT_BEGIN_NAMESPACE + namespace fmt_detail { struct time_zone { template @@ -37,8 +39,6 @@ template inline auto current_zone(T...) -> time_zone* { template inline void _tzset(T...) {} } // namespace fmt_detail -FMT_BEGIN_NAMESPACE - // Enable safe chrono durations, unless explicitly disabled. #ifndef FMT_SAFE_DURATION_CAST # define FMT_SAFE_DURATION_CAST 1 @@ -522,8 +522,8 @@ auto to_time_t(sys_time time_point) -> std::time_t { // Workaround a bug in libstdc++ which sets __cpp_lib_chrono to 201907 without // providing current_zone(): https://github.com/fmtlib/fmt/issues/4160. template FMT_CONSTEXPR auto has_current_zone() -> bool { - using namespace std::chrono; - using namespace fmt_detail; + using std::chrono::current_zone; + using fmt_detail::current_zone; return !std::is_same::value; } } // namespace detail