Have format set exceptions(failbit | badbit)

*  Be sure if something bad happens under the hood it is not silently
   swallowed.
This commit is contained in:
Howard Hinnant 2017-10-14 20:44:16 -04:00
parent 264fd7c62a
commit 78c120f74a
2 changed files with 18 additions and 9 deletions

View File

@ -2980,7 +2980,8 @@ is a valid expression.
<p>
<i>Effects:</i> Constructs a local variable of type
<code>basic_ostringstream&lt;charT&gt;</code> (for exposition purposes, named
<code>os</code>). Then calls <code>to_stream(os, fmt, s)</code>.
<code>os</code>). Executes <code>os.exceptions(ios::failbit | ios::badbit)</code>.
Then calls <code>to_stream(os, fmt, s)</code>.
</p>
<p>
@ -3004,8 +3005,8 @@ is a valid expression.
<p>
<i>Effects:</i> Constructs a local variable of type
<code>basic_ostringstream&lt;charT&gt;</code> (for exposition purposes, named
<code>os</code>). Then calls <code>os.imbue(loc)</code>. Then calls
<code>to_stream(os, fmt, s)</code>.
<code>os</code>). Executes <code>os.exceptions(ios::failbit | ios::badbit)</code>.
Then calls <code>os.imbue(loc)</code>. Then calls <code>to_stream(os, fmt, s)</code>.
</p>
<p>
@ -3029,7 +3030,8 @@ is a valid expression.
<p>
<i>Effects:</i> Constructs a local variable of type
<code>basic_ostringstream&lt;charT, traits, Alloc&gt;</code> (for exposition purposes, named
<code>os</code>). Then calls <code>to_stream(os, fmt.c_str(), s)</code>.
<code>os</code>). Executes <code>os.exceptions(ios::failbit | ios::badbit)</code>.
Then calls <code>to_stream(os, fmt.c_str(), s)</code>.
</p>
<p>
@ -3053,8 +3055,9 @@ is a valid expression.
<p>
<i>Effects:</i> Constructs a local variable of type
<code>basic_ostringstream&lt;charT, traits, Alloc&gt;</code> (for exposition purposes, named
<code>os</code>). Then calls <code>os.imbue(loc)</code>. Then calls
<code>to_stream(os, fmt.c_str(), s)</code>.
<code>os</code>). Then calls <code>os.imbue(loc)</code>.
Executes <code>os.exceptions(ios::failbit | ios::badbit)</code>.
Then calls <code>to_stream(os, fmt.c_str(), s)</code>.
</p>
<p>

View File

@ -26,7 +26,7 @@
<br/>
<br/>
<a href="mailto:howard.hinnant@gmail.com">Howard E. Hinnant</a><br/>
2017-09-30<br/>
2017-10-14<br/>
</address>
<hr/>
<h1 align=center><code>date</code></h1>
@ -7922,7 +7922,9 @@ is valid.
</p>
<p>
<i>Effects:</i> Constructs a <code>std::basic_ostringstream&lt;CharT&gt; os</code> and
imbues it with <code>loc</code>. Calls <code>to_stream(os, fmt, tp)</code>.
imbues it with <code>loc</code>.
Executes <code>os.exceptions(std::ios::failbit | std::ios::badbit)</code>.
Calls <code>to_stream(os, fmt, tp)</code>.
</p>
<p>
<i>Returns:</i> <code>os.str()</code>.
@ -7943,6 +7945,7 @@ is valid.
</p>
<p>
<i>Effects:</i> Constructs a <code>std::basic_ostringstream&lt;CharT&gt; os</code>.
Executes <code>os.exceptions(std::ios::failbit | std::ios::badbit)</code>.
Calls <code>to_stream(os, fmt, tp)</code>.
</p>
<p>
@ -7964,7 +7967,9 @@ is valid.
</p>
<p>
<i>Effects:</i> Constructs a <code>std::basic_ostringstream&lt;CharT&gt; os</code> and
imbues it with <code>loc</code>. Calls <code>to_stream(os, fmt.c_str(), tp)</code>.
imbues it with <code>loc</code>.
Executes <code>os.exceptions(std::ios::failbit | std::ios::badbit)</code>.
Calls <code>to_stream(os, fmt.c_str(), tp)</code>.
</p>
<p>
<i>Returns:</i> <code>os.str()</code>.
@ -7985,6 +7990,7 @@ is valid.
</p>
<p>
<i>Effects:</i> Constructs a <code>std::basic_ostringstream&lt;CharT&gt; os</code>.
Executes <code>os.exceptions(std::ios::failbit | std::ios::badbit)</code>.
Calls <code>to_stream(os, fmt.c_str(), tp)</code>.
</p>
<p>