Commit c123a728 authored by Владислав Щапов's avatar Владислав Щапов Committed by Victor Zverovich

Fix set locale error in chrono formatter

parent 3c8fad12
...@@ -291,6 +291,7 @@ inline null<> gmtime_s(...) { return null<>(); } ...@@ -291,6 +291,7 @@ inline null<> gmtime_s(...) { return null<>(); }
inline auto do_write(const std::tm& time, const std::locale& loc, char format, inline auto do_write(const std::tm& time, const std::locale& loc, char format,
char modifier) -> std::string { char modifier) -> std::string {
auto&& os = std::ostringstream(); auto&& os = std::ostringstream();
os.imbue(loc);
using iterator = std::ostreambuf_iterator<char>; using iterator = std::ostreambuf_iterator<char>;
const auto& facet = std::use_facet<std::time_put<char, iterator>>(loc); const auto& facet = std::use_facet<std::time_put<char, iterator>>(loc);
auto end = facet.put(os, os, ' ', &time, format, modifier); auto end = facet.put(os, os, ' ', &time, format, modifier);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment