<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Exception]]></title><description><![CDATA[<p>Hi,<br />
ich hab hier ein stück code, von dem ich nur ungefähr weiß was passiert. das ganze ist ein konstruktor mit initialisierungsliste, soweit klar. aber die zeile in den blockklammern versteh ich nicht. wofür ist die da? was tut sie? was passiert wenn man sie weglässt?</p>
<pre><code class="language-cpp">Myclass::Myclass() : string1_(&quot;test&quot;), string2_(&quot;konstruktor&quot;)
{
  std::cin.exceptions(std::istream::failbit | std::istream::badbit); // unklar
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/267860/exception</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 06:57:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/267860.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 31 May 2010 14:05:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Exception on Mon, 31 May 2010 14:05:21 GMT]]></title><description><![CDATA[<p>Hi,<br />
ich hab hier ein stück code, von dem ich nur ungefähr weiß was passiert. das ganze ist ein konstruktor mit initialisierungsliste, soweit klar. aber die zeile in den blockklammern versteh ich nicht. wofür ist die da? was tut sie? was passiert wenn man sie weglässt?</p>
<pre><code class="language-cpp">Myclass::Myclass() : string1_(&quot;test&quot;), string2_(&quot;konstruktor&quot;)
{
  std::cin.exceptions(std::istream::failbit | std::istream::badbit); // unklar
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1904967</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1904967</guid><dc:creator><![CDATA[dani 1988]]></dc:creator><pubDate>Mon, 31 May 2010 14:05:21 GMT</pubDate></item><item><title><![CDATA[Reply to Exception on Mon, 31 May 2010 14:09:18 GMT]]></title><description><![CDATA[<p>Einfach mal nachlesen...<br />
<a href="http://www.cplusplus.com/reference/iostream/ios/exceptions/" rel="nofollow">http://www.cplusplus.com/reference/iostream/ios/exceptions/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1904971</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1904971</guid><dc:creator><![CDATA[Janjan]]></dc:creator><pubDate>Mon, 31 May 2010 14:09:18 GMT</pubDate></item><item><title><![CDATA[Reply to Exception on Mon, 31 May 2010 14:09:42 GMT]]></title><description><![CDATA[<p><a href="http://www.cplusplus.com/reference/iostream/ios/exceptions/" rel="nofollow">http://www.cplusplus.com/reference/iostream/ios/exceptions/</a></p>
<p>Die Anweisung setzt das failbit und das badbit von cin. Warum man das tun sollte, ist mir ein Rätsel.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1904972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1904972</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 31 May 2010 14:09:42 GMT</pubDate></item><item><title><![CDATA[Reply to Exception on Mon, 31 May 2010 14:16:02 GMT]]></title><description><![CDATA[<p>ah, danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1904975</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1904975</guid><dc:creator><![CDATA[dani 1988]]></dc:creator><pubDate>Mon, 31 May 2010 14:16:02 GMT</pubDate></item><item><title><![CDATA[Reply to Exception on Mon, 31 May 2010 14:21:05 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p><a href="http://www.cplusplus.com/reference/iostream/ios/exceptions/" rel="nofollow">http://www.cplusplus.com/reference/iostream/ios/exceptions/</a></p>
<p>Die Anweisung setzt das failbit und das badbit von cin. Warum man das tun sollte, ist mir ein Rätsel.</p>
</blockquote>
<p>Nein, die Funktion setzt die Exception-Maske.<br />
Das bewirkt dass bei Fehlern die Das Fail- und/oder Bad-Bit setzen eine Exception geworfen wird, statt dass einfach nur die Bits gesetzt werden.<br />
Und das macht durchaus Sinn.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1904982</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1904982</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Mon, 31 May 2010 14:21:05 GMT</pubDate></item></channel></rss>