<?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[throw in catch]]></title><description><![CDATA[<p>Ich habe das hier getestet und bekomme keine Warnung:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;stdexcept&gt;

int main() try
{
	using namespace std;
	try
	{
		cout &lt;&lt; &quot;value=&quot;;
		int value=0;
		if(cin&gt;&gt;value)
		{
			cout &lt;&lt; &quot;value=&quot; &lt;&lt; value &lt;&lt; endl;
		}
		else
		{
			throw runtime_error( &quot;bad input&quot; );
		}
	}	
	catch(const runtime_error&amp; error)
	{
		throw runtime_error(error.what());
	}
}
catch(const std::runtime_error&amp; error)
{
	std::cout &lt;&lt; &quot;runtime_error: &quot; &lt;&lt; error.what() &lt;&lt; std::endl;
}
</code></pre>
<p>Es funktioniert auch ohne Probleme, aber ich habe habe mal gelesen dass das in C++ eigentlich nicht so reibungslos gehen kann. Habe ich da mal was falsch gelesen, oder sollte ich so etwas lassen ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/309984/throw-in-catch</link><generator>RSS for Node</generator><lastBuildDate>Wed, 05 Aug 2026 02:34:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/309984.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 31 Oct 2012 23:19:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to throw in catch on Wed, 31 Oct 2012 23:19:09 GMT]]></title><description><![CDATA[<p>Ich habe das hier getestet und bekomme keine Warnung:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;stdexcept&gt;

int main() try
{
	using namespace std;
	try
	{
		cout &lt;&lt; &quot;value=&quot;;
		int value=0;
		if(cin&gt;&gt;value)
		{
			cout &lt;&lt; &quot;value=&quot; &lt;&lt; value &lt;&lt; endl;
		}
		else
		{
			throw runtime_error( &quot;bad input&quot; );
		}
	}	
	catch(const runtime_error&amp; error)
	{
		throw runtime_error(error.what());
	}
}
catch(const std::runtime_error&amp; error)
{
	std::cout &lt;&lt; &quot;runtime_error: &quot; &lt;&lt; error.what() &lt;&lt; std::endl;
}
</code></pre>
<p>Es funktioniert auch ohne Probleme, aber ich habe habe mal gelesen dass das in C++ eigentlich nicht so reibungslos gehen kann. Habe ich da mal was falsch gelesen, oder sollte ich so etwas lassen ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2266097</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2266097</guid><dc:creator><![CDATA[catchme]]></dc:creator><pubDate>Wed, 31 Oct 2012 23:19:09 GMT</pubDate></item><item><title><![CDATA[Reply to throw in catch on Wed, 31 Oct 2012 23:22:21 GMT]]></title><description><![CDATA[<p>Wie sollte man sonst Teile der Exception nach außen weiterreichen? Ist manchmal nötig und ich wüsste auch nicht, warum das nicht reibungslos funktionieren sollte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2266098</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2266098</guid><dc:creator><![CDATA[Der Tobi]]></dc:creator><pubDate>Wed, 31 Oct 2012 23:22:21 GMT</pubDate></item><item><title><![CDATA[Reply to throw in catch on Thu, 01 Nov 2012 00:28:59 GMT]]></title><description><![CDATA[<p>Warum genau willst du da auch eine Warnung bekommen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2266103</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2266103</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Thu, 01 Nov 2012 00:28:59 GMT</pubDate></item><item><title><![CDATA[Reply to throw in catch on Thu, 01 Nov 2012 06:49:52 GMT]]></title><description><![CDATA[<p>im destruktor sollte man sowas nicht machen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2266122</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2266122</guid><dc:creator><![CDATA[destroyar]]></dc:creator><pubDate>Thu, 01 Nov 2012 06:49:52 GMT</pubDate></item><item><title><![CDATA[Reply to throw in catch on Thu, 01 Nov 2012 08:19:28 GMT]]></title><description><![CDATA[<p>destroyar schrieb:</p>
<blockquote>
<p>im destruktor sollte man sowas nicht machen</p>
</blockquote>
<p>Dazu vielleicht ganz interessant (auch wenn es dem Statement zum jetzigen Zeitpunkt natürlich nicht widerspricht, werft nicht aus Destruktoren! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /> )<br />
<a href="http://cpp-next.com/archive/2012/08/evil-or-just-misunderstood/" rel="nofollow">http://cpp-next.com/archive/2012/08/evil-or-just-misunderstood/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2266131</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2266131</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Thu, 01 Nov 2012 08:19:28 GMT</pubDate></item><item><title><![CDATA[Reply to throw in catch on Thu, 01 Nov 2012 08:35:49 GMT]]></title><description><![CDATA[<p>Ich habe keine Ahnung, was ein Exceptionhandler eines zu main gehörenden Function-try-Blocks, der weder per return noch per throw beendet wird, bewirkt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2266134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2266134</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Thu, 01 Nov 2012 08:35:49 GMT</pubDate></item><item><title><![CDATA[Reply to throw in catch on Thu, 01 Nov 2012 08:52:06 GMT]]></title><description><![CDATA[<p>cooky451 schrieb:</p>
<blockquote>
<p><a href="http://cpp-next.com/archive/2012/08/evil-or-just-misunderstood/" rel="nofollow">http://cpp-next.com/archive/2012/08/evil-or-just-misunderstood/</a></p>
</blockquote>
<p>Was soll da stehen? Ich seh nur weiß???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2266138</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2266138</guid><dc:creator><![CDATA[hhhmmmmmm????]]></dc:creator><pubDate>Thu, 01 Nov 2012 08:52:06 GMT</pubDate></item></channel></rss>