<?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 &amp;quot;fubar&amp;quot; - Fragen zum Standard]]></title><description><![CDATA[<p>Gegeben sei</p>
<pre><code class="language-cpp">try
{
   throw &quot;abc&quot;;
}
catch (char [4])
{
   cout &lt;&lt; &quot;caught!\n&quot;;
}
</code></pre>
<p>meinem verständnis nach sollte die exception nicht gefangen werden, da der handler aber nur für char* zulässig ist (nach 15.3/2 *nicht* für char[4]).<br />
allerdings sagt 15.1/3, dass für ein string-literal in diesem kontext niemals die konvertierung in den entsprechenden char-(non-const)-zeiger geschieht. meine frage: ist das temporary nun ein array char[4] oder ein zeiger auf const-char?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/226042/throw-quot-fubar-quot-fragen-zum-standard</link><generator>RSS for Node</generator><lastBuildDate>Thu, 01 Oct 2026 07:20:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/226042.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 Oct 2008 15:19:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to throw &amp;quot;fubar&amp;quot; - Fragen zum Standard on Tue, 28 Oct 2008 15:19:54 GMT]]></title><description><![CDATA[<p>Gegeben sei</p>
<pre><code class="language-cpp">try
{
   throw &quot;abc&quot;;
}
catch (char [4])
{
   cout &lt;&lt; &quot;caught!\n&quot;;
}
</code></pre>
<p>meinem verständnis nach sollte die exception nicht gefangen werden, da der handler aber nur für char* zulässig ist (nach 15.3/2 *nicht* für char[4]).<br />
allerdings sagt 15.1/3, dass für ein string-literal in diesem kontext niemals die konvertierung in den entsprechenden char-(non-const)-zeiger geschieht. meine frage: ist das temporary nun ein array char[4] oder ein zeiger auf const-char?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1606118</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1606118</guid><dc:creator><![CDATA[thrower]]></dc:creator><pubDate>Tue, 28 Oct 2008 15:19:54 GMT</pubDate></item><item><title><![CDATA[Reply to throw &amp;quot;fubar&amp;quot; - Fragen zum Standard on Tue, 28 Oct 2008 15:53:05 GMT]]></title><description><![CDATA[<p>Ich denke mal, dass das hier passiert:</p>
<p>ISO/IEC 14882:2003 schrieb:</p>
<blockquote>
<p>A throw-expression initializes a temporary object, called the exception object, the type of which is determined by removing [...] and adjusting the type from “array of T” or [...] to “pointer to T” or [...]</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1606151</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1606151</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Tue, 28 Oct 2008 15:53:05 GMT</pubDate></item></channel></rss>