Skip to content

Commit 584a87e

Browse files
committed
[time.hms.nonmembers] Fix editorial error in hh_mm_ss operator<< (only
stream to 'os' once). This formulation was proposed by Howard Hinnant on the lib reflector.
1 parent 8f584c2 commit 584a87e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

source/time.tex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8039,9 +8039,10 @@
80398039
\effects
80408040
Equivalent to:
80418041
\begin{codeblock}
8042-
if (hms.is_negative())
8043-
os << @\placeholder{STATICALLY-WIDEN}@<charT>("-");
8044-
return os << format(os.getloc(), @\placeholder{STATICALLY-WIDEN}@<charT>("{:%T}"), hms);
8042+
return os << format(os.getloc(),
8043+
hms.is_negative() ? @\placeholder{STATICALLY-WIDEN}@<charT>("-{:%T}")
8044+
: @\placeholder{STATICALLY-WIDEN}@<charT>("{:%T}"),
8045+
abs(hms.to_duration()));
80458046
\end{codeblock}
80468047

80478048
\pnum

0 commit comments

Comments
 (0)