<?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[Frage bzgl. Compileroptimierung]]></title><description><![CDATA[<p>Würde ein optimierender Compiler die Variable c im folgenden Fall statisch anlegen?</p>
<pre><code class="language-cpp">void Foo(const A&amp; a, B&amp; b) {

    C c;
    c&lt;&lt; 363 &lt;&lt;68 &lt;&lt;687 &lt;&lt;4543 &lt;&lt;436 &lt;&lt;789;

    b = a*c;
}
</code></pre>
<p>Oder ginge das nur, wenn ich bereits im Konstruktor die Werte zuweise (was C nicht anbietet)</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/303218/frage-bzgl-compileroptimierung</link><generator>RSS for Node</generator><lastBuildDate>Mon, 10 Aug 2026 16:59:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/303218.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 08 May 2012 11:27:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage bzgl. Compileroptimierung on Tue, 08 May 2012 11:27:53 GMT]]></title><description><![CDATA[<p>Würde ein optimierender Compiler die Variable c im folgenden Fall statisch anlegen?</p>
<pre><code class="language-cpp">void Foo(const A&amp; a, B&amp; b) {

    C c;
    c&lt;&lt; 363 &lt;&lt;68 &lt;&lt;687 &lt;&lt;4543 &lt;&lt;436 &lt;&lt;789;

    b = a*c;
}
</code></pre>
<p>Oder ginge das nur, wenn ich bereits im Konstruktor die Werte zuweise (was C nicht anbietet)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2209405</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2209405</guid><dc:creator><![CDATA[offeneRaute]]></dc:creator><pubDate>Tue, 08 May 2012 11:27:53 GMT</pubDate></item><item><title><![CDATA[Reply to Frage bzgl. Compileroptimierung on Tue, 08 May 2012 11:35:50 GMT]]></title><description><![CDATA[<p>Was ist <code>C</code> ? Was ist <code>C::operator&lt;&lt;</code> ? Was ist <code>C::C</code> ? Was soll statisch mit Optimierung zu tun haben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2209408</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2209408</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 08 May 2012 11:35:50 GMT</pubDate></item><item><title><![CDATA[Reply to Frage bzgl. Compileroptimierung on Tue, 08 May 2012 11:40:27 GMT]]></title><description><![CDATA[<p>Grundsätzlich könnte der Compiler eine solche Optimierung nur durchführen, wenn die Implementierung von C::C(), operator&lt;&lt;(C&amp;, int) und operator*(A const&amp;, C const&amp;) bekannt sind. Sind diese extern, lässt sich die Frage ganz klar mit nein beantworten.</p>
<p>Sollten alle diese Operationen beim Compilieren bekannt sein, keine Seiteneffekte haben (und selbst keine Operationen mit Seiteneffekt aufrufen) und Konstanten produzieren, würde mich die Antwort allerdings auch interessieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2209409</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2209409</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Tue, 08 May 2012 11:40:27 GMT</pubDate></item></channel></rss>