Skip to content

Commit

Permalink
Make wide string literals in to_stream
Browse files Browse the repository at this point in the history
  • Loading branch information
HowardHinnant committed Jun 17, 2017
1 parent 012f2c6 commit a003ad2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tz.h
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,8 @@ inline
std::basic_ostream<CharT, Traits>&
operator<<(std::basic_ostream<CharT, Traits>& os, const zoned_time<Duration>& 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
Expand Down Expand Up @@ -1231,7 +1232,8 @@ template <class CharT, class Traits, class Duration>
std::basic_ostream<CharT, Traits>&
operator<<(std::basic_ostream<CharT, Traits>& os, const utc_time<Duration>& t)
{
return to_stream(os, "%F %T", t);
const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}};
return to_stream(os, fmt, t);
}

template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
Expand Down Expand Up @@ -1347,7 +1349,8 @@ template <class CharT, class Traits, class Duration>
std::basic_ostream<CharT, Traits>&
operator<<(std::basic_ostream<CharT, Traits>& os, const tai_time<Duration>& t)
{
return to_stream(os, "%F %T", t);
const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}};
return to_stream(os, fmt, t);
}

template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
Expand Down Expand Up @@ -1453,7 +1456,8 @@ template <class CharT, class Traits, class Duration>
std::basic_ostream<CharT, Traits>&
operator<<(std::basic_ostream<CharT, Traits>& os, const gps_time<Duration>& t)
{
return to_stream(os, detail::make_string<CharT, Traits>::from("%F %T").c_str(), t);
const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}};
return to_stream(os, fmt, t);
}

template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
Expand Down

0 comments on commit a003ad2

Please sign in to comment.