From a003ad28fa4b25216974ce5134fb29c144519720 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Sat, 17 Jun 2017 13:18:40 -0400 Subject: [PATCH] Make wide string literals in to_stream --- tz.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tz.h b/tz.h index c1c261fd..47a63b46 100644 --- a/tz.h +++ b/tz.h @@ -1122,7 +1122,8 @@ inline std::basic_ostream& operator<<(std::basic_ostream& os, const zoned_time& t) { - return to_stream(os, "%F %T %Z", t); + const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}}; + return to_stream(os, fmt, t); } #if !MISSING_LEAP_SECONDS @@ -1231,7 +1232,8 @@ template std::basic_ostream& operator<<(std::basic_ostream& os, const utc_time& t) { - return to_stream(os, "%F %T", t); + const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}}; + return to_stream(os, fmt, t); } template > @@ -1347,7 +1349,8 @@ template std::basic_ostream& operator<<(std::basic_ostream& os, const tai_time& t) { - return to_stream(os, "%F %T", t); + const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}}; + return to_stream(os, fmt, t); } template > @@ -1453,7 +1456,8 @@ template std::basic_ostream& operator<<(std::basic_ostream& os, const gps_time& t) { - return to_stream(os, detail::make_string::from("%F %T").c_str(), t); + const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}}; + return to_stream(os, fmt, t); } template >