<?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[VS2012 STL nicht vollständig?]]></title><description><![CDATA[<p><a href="http://cryp.to/default-constructor-riddle/" rel="nofollow">Rästel-Code</a><br />
--&gt;</p>
<pre><code>#include &lt;string&gt;
#include &lt;iostream&gt;

int main()
{
    std::string prefix(&quot;-&gt;&quot;), middle(), suffix(&quot;&lt;-&quot;);
    std::cout &lt;&lt; &quot;This space has been intentionally left blank: &quot;
              &lt;&lt; prefix &lt;&lt; middle &lt;&lt; suffix
              &lt;&lt; std::endl;

    return 0;
}
</code></pre>
<p>(Linker-)Fehlermeldung von VS2012:</p>
<pre><code>1&gt;Main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;&quot;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; __cdecl middle(void)&quot; (?middle@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)&quot; in Funktion &quot;_main&quot;.
1&gt;X:\FUUUUUU.exe : fatal error LNK1120: 1 nicht aufgelöste Externe
</code></pre>
<p>Ausgabe laut Ideone:</p>
<pre><code>This space has been intentionally left blank: -&gt;1&lt;-
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/318990/vs2012-stl-nicht-vollständig</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Jul 2026 06:30:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/318990.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Aug 2013 20:30:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to VS2012 STL nicht vollständig? on Fri, 02 Aug 2013 20:30:08 GMT]]></title><description><![CDATA[<p><a href="http://cryp.to/default-constructor-riddle/" rel="nofollow">Rästel-Code</a><br />
--&gt;</p>
<pre><code>#include &lt;string&gt;
#include &lt;iostream&gt;

int main()
{
    std::string prefix(&quot;-&gt;&quot;), middle(), suffix(&quot;&lt;-&quot;);
    std::cout &lt;&lt; &quot;This space has been intentionally left blank: &quot;
              &lt;&lt; prefix &lt;&lt; middle &lt;&lt; suffix
              &lt;&lt; std::endl;

    return 0;
}
</code></pre>
<p>(Linker-)Fehlermeldung von VS2012:</p>
<pre><code>1&gt;Main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;&quot;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; __cdecl middle(void)&quot; (?middle@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)&quot; in Funktion &quot;_main&quot;.
1&gt;X:\FUUUUUU.exe : fatal error LNK1120: 1 nicht aufgelöste Externe
</code></pre>
<p>Ausgabe laut Ideone:</p>
<pre><code>This space has been intentionally left blank: -&gt;1&lt;-
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2343072</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343072</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Fri, 02 Aug 2013 20:30:08 GMT</pubDate></item><item><title><![CDATA[Reply to VS2012 STL nicht vollständig? on Fri, 02 Aug 2013 20:32:11 GMT]]></title><description><![CDATA[<p>Achja, die Frage:</p>
<p>Hä??<br />
Wieso?</p>
<p>Ich würde selbst eigentlich vermuten, dass da die Adresse der Funktion std::string middle() rauskommt. Aber das erklärt nicht die 1 beim GCC und der MSVC kann ja eigentlich auch mit nicht aufgerufenen Funktionen in der Ausgabe umgehen oO</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343074</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343074</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Fri, 02 Aug 2013 20:32:11 GMT</pubDate></item><item><title><![CDATA[Reply to VS2012 STL nicht vollständig? on Fri, 02 Aug 2013 20:43:06 GMT]]></title><description><![CDATA[<p>Skym0sh0 schrieb:</p>
<blockquote>
<p>Ich würde selbst eigentlich vermuten, dass da die Adresse der Funktion std::string middle() rauskommt. Aber das erklärt nicht die 1 beim GCC und der MSVC kann ja eigentlich auch mit nicht aufgerufenen Funktionen in der Ausgabe umgehen oO</p>
</blockquote>
<p>Der GCC benutzt, dass eine Funktion nicht Adresse 0 haben kann und optimiert das daher zu true:</p>
<pre><code>test.cc:8:28: warning: the address of \u2018std::string middle()\u2019 will always evaluate as \u2018true\u2019 [-Waddress]
               &lt;&lt; prefix &lt;&lt; middle &lt;&lt; suffix
</code></pre>
<p>Der MSVC will hingegen wirklich die Adresse der Funktion wissen, bevor er sich darauf einlässt. Dummerweise ist sie nirgends definiert.</p>
<p>Ich würde, ohne den Standard zu wälzen, sagen, dass beide Recht haben. Der Standard sagt normalerweise nicht viel über Linkage. Ob es regulär ist, die Adresse einer nicht-existierenden Funktion zu nehmen würde ich daher als einen Fall vermuten, der im Standard gar nicht weiter erwähnt wird. Aber ich habe nicht geguckt. Ich warte selber auf die Antwort derer, die den Standard auswendig kennen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343079</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343079</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 02 Aug 2013 20:43:06 GMT</pubDate></item><item><title><![CDATA[Reply to VS2012 STL nicht vollständig? on Fri, 02 Aug 2013 20:52:00 GMT]]></title><description><![CDATA[<p>Selbst wenn sie definiert wäre... Wenn ich mir die Überladungen von ostream::operator&lt;&lt; anschaue:</p>
<pre><code>ostream&amp; operator&lt;&lt; (bool val);
ostream&amp; operator&lt;&lt; (short val);
ostream&amp; operator&lt;&lt; (unsigned short val);
ostream&amp; operator&lt;&lt; (int val);
ostream&amp; operator&lt;&lt; (unsigned int val);
ostream&amp; operator&lt;&lt; (long val);
ostream&amp; operator&lt;&lt; (unsigned long val);
ostream&amp; operator&lt;&lt; (float val);
ostream&amp; operator&lt;&lt; (double val);
ostream&amp; operator&lt;&lt; (long double val);
ostream&amp; operator&lt;&lt; (void* val);
</code></pre>
<p>Da gibt es nur eine Überladung die einen Zeiger nimmt. Aber da es ein void-Zeiger ist, geht das doch sowieso nicht. Ein Funktionszeiger kann nicht implizit in einen void-Zeiger konvertiert werden, oder täusch ich mich da nun?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343085</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343085</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Fri, 02 Aug 2013 20:52:00 GMT</pubDate></item><item><title><![CDATA[Reply to VS2012 STL nicht vollständig? on Fri, 02 Aug 2013 20:55:52 GMT]]></title><description><![CDATA[<p>out schrieb:</p>
<blockquote>
<p>Ein Funktionszeiger kann nicht implizit in einen void-Zeiger konvertiert werden, oder täusch ich mich da nun?</p>
</blockquote>
<p>Nö, das ist nur für Objekttypen definiert</p>
<blockquote>
<p>A prvalue of type “pointer to cv T,” <strong>where T is an object type</strong>, can be converted to a prvalue of type “pointer<br />
to cv void”.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2343086</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343086</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 02 Aug 2013 20:55:52 GMT</pubDate></item><item><title><![CDATA[Reply to VS2012 STL nicht vollständig? on Fri, 02 Aug 2013 22:37:44 GMT]]></title><description><![CDATA[<p>out schrieb:</p>
<blockquote>
<p>Ein Funktionszeiger kann nicht implizit in einen void-Zeiger konvertiert werden, oder täusch ich mich da nun?</p>
</blockquote>
<p>Kann er eh nicht.<br />
Muss er auch nicht.<br />
Die implizierte Konvertierung nach bool funktioniert aber trotzdem.<br />
Der Unterschied ist bloss, dass MSVC den Vergleich nicht wegoptimiert, ideone dagegen schon.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343109</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Fri, 02 Aug 2013 22:37:44 GMT</pubDate></item><item><title><![CDATA[Reply to VS2012 STL nicht vollständig? on Sat, 03 Aug 2013 09:02:02 GMT]]></title><description><![CDATA[<p>Naja, war im Debug Modus, wer weiss was der bei allen optimierungen gemacht hätte.</p>
<p>Aber letztlich ist der Fehler also, dass die Implementation der middle-Funktion fehlt und deshalb der Linker meckert?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343144</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343144</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Sat, 03 Aug 2013 09:02:02 GMT</pubDate></item><item><title><![CDATA[Reply to VS2012 STL nicht vollständig? on Sat, 03 Aug 2013 09:09:10 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Ich würde, ohne den Standard zu wälzen, sagen, dass beide Recht haben.</p>
</blockquote>
<p>So ist es.<br />
Die Bestimmung der Adresse einer Funktion (in einem potentiell ausgewerteten Ausdruck) stellt eine ODR-Nutzung derselben dar (3.2/2).<br />
Für jede nicht-inline Funktion, die ODR-genutzt wird, muss im Programm genau eine Definition existieren, eine Diagnose durch den Compiler ist aber nicht erforderlich (3.2/3).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2343147</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2343147</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sat, 03 Aug 2013 09:09:10 GMT</pubDate></item></channel></rss>