From 98ac2e273d61705e723cde86d2fc2f1c8d9aba0a Mon Sep 17 00:00:00 2001 From: Vladislav Shchapov Date: Fri, 5 Nov 2021 13:54:41 +0500 Subject: [PATCH] Rename locale-specific tm formatting function --- include/fmt/chrono.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index b4f042dc128d2..7410090b016af 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -290,8 +290,9 @@ inline null<> gmtime_r(...) { return null<>(); } inline null<> gmtime_s(...) { return null<>(); } template -inline auto do_write(const std::tm& time, const std::locale& loc, char format, - char modifier) -> std::basic_string { +inline auto do_write_localized(const std::tm& time, const std::locale& loc, + char format, char modifier) + -> std::basic_string { auto&& os = std::basic_ostringstream(); os.imbue(loc); using iterator = std::ostreambuf_iterator; @@ -303,17 +304,17 @@ inline auto do_write(const std::tm& time, const std::locale& loc, char format, template ::value)> -auto write(OutputIt out, const std::tm& time, const std::locale& loc, - char format, char modifier = 0) -> OutputIt { - auto str = do_write(time, loc, format, modifier); +auto write_localized(OutputIt out, const std::tm& time, const std::locale& loc, + char format, char modifier = 0) -> OutputIt { + auto str = do_write_localized(time, loc, format, modifier); return std::copy(str.begin(), str.end(), out); } template ::value)> -auto write(OutputIt out, const std::tm& time, const std::locale& loc, - char format, char modifier = 0) -> OutputIt { - auto str = do_write(time, loc, format, modifier); +auto write_localized(OutputIt out, const std::tm& time, const std::locale& loc, + char format, char modifier = 0) -> OutputIt { + auto str = do_write_localized(time, loc, format, modifier); if (detail::is_utf8() && loc != std::locale::classic()) { // char16_t and char32_t codecvts are broken in MSVC (linkage errors) and // gcc-4. @@ -984,7 +985,7 @@ template class tm_writer { } void format_localized(char format, char modifier = 0) { - out_ = write(out_, tm_, loc_, format, modifier); + out_ = write_localized(out_, tm_, loc_, format, modifier); } public: