<?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[Bin mal wieder blind... (STL) STL-Bug?]]></title><description><![CDATA[<p>Hallo!</p>
<p>Mir macht mal wieder die STL zu schaffen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> Die Folgenden Zeilen liefern mir komische Fehler:</p>
<pre><code class="language-cpp">void print_help() {
	std::wcout &lt;&lt; L&quot;Hilfe:\tshutdown\t- Fährt den Server herunter\n&quot;
		   &lt;&lt; L&quot;\thelp\t- Zeigt das Hilfemenü\n&quot;;
}

std::map&lt;std::wstring, void ()&gt; command_table;
command_table.insert(std::make_pair(L&quot;help&quot;, print_help));
</code></pre>
<pre><code>error C2752: 'std::tr1::_Remove_reference&lt;_Ty&gt;' : more than one partial specialization matches the template argument list (irendwo in &lt;type_traits&gt;)

error C2528: 'abstract declarator' : pointer to reference is illegal

error C2528: 'type' : pointer to reference is illegal
</code></pre>
<p>Bin wohl wirklich blind...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/266156/bin-mal-wieder-blind-stl-stl-bug</link><generator>RSS for Node</generator><lastBuildDate>Thu, 03 Sep 2026 13:30:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/266156.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 May 2010 19:16:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 19:48:45 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Mir macht mal wieder die STL zu schaffen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> Die Folgenden Zeilen liefern mir komische Fehler:</p>
<pre><code class="language-cpp">void print_help() {
	std::wcout &lt;&lt; L&quot;Hilfe:\tshutdown\t- Fährt den Server herunter\n&quot;
		   &lt;&lt; L&quot;\thelp\t- Zeigt das Hilfemenü\n&quot;;
}

std::map&lt;std::wstring, void ()&gt; command_table;
command_table.insert(std::make_pair(L&quot;help&quot;, print_help));
</code></pre>
<pre><code>error C2752: 'std::tr1::_Remove_reference&lt;_Ty&gt;' : more than one partial specialization matches the template argument list (irendwo in &lt;type_traits&gt;)

error C2528: 'abstract declarator' : pointer to reference is illegal

error C2528: 'type' : pointer to reference is illegal
</code></pre>
<p>Bin wohl wirklich blind...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892463</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892463</guid><dc:creator><![CDATA[Ad aCTa]]></dc:creator><pubDate>Tue, 04 May 2010 19:48:45 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 19:23:04 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::map&lt;std::wstring, void (*)()&gt; command_table;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1892468</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892468</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Tue, 04 May 2010 19:23:04 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 19:27:26 GMT]]></title><description><![CDATA[<p>Hab ich vorhin schon probiert, mit selbem Ergebnis. Beim obigen Code habe ich noch eine Warnung verschwiegen:</p>
<pre><code>warning C4180: qualifier applied to function type has no meaning; ignored	(diesmal in &lt;map&gt;)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1892470</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892470</guid><dc:creator><![CDATA[Ad aCTa]]></dc:creator><pubDate>Tue, 04 May 2010 19:27:26 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 19:35:22 GMT]]></title><description><![CDATA[<p>Komischerweise geht ja das auch nicht (was zwar weniger performant, mir aber lieber wäre):</p>
<pre><code class="language-cpp">command_table[L&quot;help&quot;] = print_help;
</code></pre>
<pre><code>error C3853: '=': re-initializing a reference or assignment through a reference-to-function is illegal
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1892471</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892471</guid><dc:creator><![CDATA[Ad aCTa]]></dc:creator><pubDate>Tue, 04 May 2010 19:35:22 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 19:35:28 GMT]]></title><description><![CDATA[<p>Zeig mal ein komplettes Beispiel. Habs mal eben mit MSVC++ 2008 getestet und der bringt bei höchster Warnstufe keine Warning.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892472</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892472</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Tue, 04 May 2010 19:35:28 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 19:40:05 GMT]]></title><description><![CDATA[<p>(Theoretisch) Kompilierbares Minimalbeispiel:</p>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;iostream&gt;
#include &lt;map&gt;

void print_help() {
	std::wcout &lt;&lt; L&quot;Hilfe:\tshutdown\t- Fährt den Server herunter\n&quot;
			   &lt;&lt; L&quot;\thelp\t- Zeigt das Hilfemenü\n&quot;;
}

int main() {
	std::map&lt;std::wstring, void (*)()&gt; command_table;
	command_table.insert(std::make_pair(L&quot;help&quot;, print_help));
}
</code></pre>
<p>Sind die 3 Fehler. Ich benutze Visual C++ Express 2010.</p>
<p>Schreibe ich void () bekomme ich noch die Warnung, schreibe ich nur void (*)() bekomme ich nur die 3 Fehler.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892473</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892473</guid><dc:creator><![CDATA[Ad aCTa]]></dc:creator><pubDate>Tue, 04 May 2010 19:40:05 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 19:45:56 GMT]]></title><description><![CDATA[<p>Okay, bei mir geht es in Visual Studio 2008 Professional anstandslos zu kompilieren. Das ist ein Bug in der MS-STL-Implementierung von VS 2010 denke ich mal. Aber darauf muss doch schon mal einer gestoßen sein?! Bugs sind doch echt nur für Beta! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /></p>
<p>Hier sind ja auch STL-Probleme aufgeführt:</p>
<p><a href="http://blogs.msdn.com/vcblog/archive/2009/05/25/stl-breaking-changes-in-visual-studio-2010-beta-1.aspx" rel="nofollow">http://blogs.msdn.com/vcblog/archive/2009/05/25/stl-breaking-changes-in-visual-studio-2010-beta-1.aspx</a></p>
<p>Die haben irgendwas mit den neuen Rvalue-Referenzen und Perfect Forwarding zerschossen, denke ich. Och menno... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892476</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892476</guid><dc:creator><![CDATA[Ad aCTa]]></dc:creator><pubDate>Tue, 04 May 2010 19:45:56 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 20:01:24 GMT]]></title><description><![CDATA[<p>So, ich habe einen Wrapper gebastelt. Nur ist der weder schön, noch kommt er mit Funktionen wie void (void) klar.</p>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;iostream&gt;
#include &lt;map&gt;

void print_help (int) {
	std::wcout &lt;&lt; L&quot;Hilfe:\tshutdown\t- Fährt den Server herunter\n&quot;
			   &lt;&lt; L&quot;\thelp\t- Zeigt das Hilfemenü\n&quot;;
	}

template &lt;typename T, typename R&gt;
struct fun_ptr : std::unary_function&lt;T, R&gt; {
	fun_ptr(R (*param)(T))
		: ptr(param) {
	};

	R operator()(T p) {
		return ptr(p);
	}

private:
	R (*ptr)(T);
};

int main() {
	typedef fun_ptr&lt;int, void&gt; fun;

	std::map&lt;std::wstring, fun&gt; p;
	fun f(print_help);
	p.insert(std::make_pair(L&quot;help&quot;, f));
}
</code></pre>
<p>Geht das kürzer? Und vor allem: dass ich Funktionen benutzen kann, die keinen Parameter nehmen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892485</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892485</guid><dc:creator><![CDATA[Ad aCTa]]></dc:creator><pubDate>Tue, 04 May 2010 20:01:24 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 20:11:38 GMT]]></title><description><![CDATA[<p>So funktioniert es auch mit VS2010.</p>
<pre><code class="language-cpp">#include &lt;string&gt; 
#include &lt;iostream&gt; 
#include &lt;map&gt; 

void print_help() { 
    std::wcout &lt;&lt; L&quot;Hilfe:\tshutdown\t- Fährt den Server herunter\n&quot; 
               &lt;&lt; L&quot;\thelp\t- Zeigt das Hilfemenü\n&quot;; 
} 

int main() { 
    std::map&lt;std::wstring, void (*)()&gt; command_table; 
    command_table.insert(std::make_pair(L&quot;help&quot;, &amp;print_help)); 
	return 0;
}
</code></pre>
<p>Früher funktionierte dies nicht:</p>
<pre><code class="language-cpp">void (*f)() = &amp;print_help;
	(*f)();
</code></pre>
<p>Anscheiend haben Sie doch in C++0x sinnvolles hinzugefügt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892493</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892493</guid><dc:creator><![CDATA[Zeus]]></dc:creator><pubDate>Tue, 04 May 2010 20:11:38 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 20:14:37 GMT]]></title><description><![CDATA[<p>Ist natürlich schöner, aber dennoch: das kann doch nicht standardkonform sein? Ob man nun vor der Funktion '&amp;' schreibt oder nicht ist bei Nicht-Elementfunktion doch AFAIK egal?! Naja, danke für den Hinweis, jetzt kann ich weitermachen! <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="🤡"
    /></p>
<p>Edit: Dein letztes Beispiel ist doch für C++98 vollkommen konform? Es funktionier auf jeden Fall in VS 2008, auch wenn man doch lieber das schreiben sollte:</p>
<pre><code class="language-cpp">void (*f)() = print_help;
f();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1892494</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892494</guid><dc:creator><![CDATA[Ad aCTa]]></dc:creator><pubDate>Tue, 04 May 2010 20:14:37 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 20:28:21 GMT]]></title><description><![CDATA[<p>Und das funktioniert leider auch nicht:</p>
<pre><code class="language-cpp">command_table[L&quot;help&quot;] = &amp;print_help;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1892498</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892498</guid><dc:creator><![CDATA[Ad aCTa]]></dc:creator><pubDate>Tue, 04 May 2010 20:28:21 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 20:31:54 GMT]]></title><description><![CDATA[<p>*hust* doch tut es <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> Zeig mal Code oder/und Fehlermeldung <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892501</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892501</guid><dc:creator><![CDATA[Zeus]]></dc:creator><pubDate>Tue, 04 May 2010 20:31:54 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Tue, 04 May 2010 21:05:48 GMT]]></title><description><![CDATA[<p>Probiers doch mal so:</p>
<pre><code class="language-cpp">typedef void(*funcPtr)();

std::map&lt;std::wstring, funcPtr&gt; command_table;

command_table.insert(std::make_pair(L&quot;help&quot;, &amp;print_help)); // &amp; ist notwendig

command_table[L&quot;help&quot;]();
</code></pre>
<p>Getestet in VS 2010.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892508</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892508</guid><dc:creator><![CDATA[hjkhjk]]></dc:creator><pubDate>Tue, 04 May 2010 21:05:48 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Wed, 05 May 2010 03:09:24 GMT]]></title><description><![CDATA[<p>Nochmal eine kurze Nachfrage...<br />
Wofür steht das L vor dem &quot;Test&quot; String?<br />
Weiß nämlich nicht, wie ich mir eine Antwort ergooglen könnte ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892549</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892549</guid><dc:creator><![CDATA[Newbie19]]></dc:creator><pubDate>Wed, 05 May 2010 03:09:24 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Wed, 05 May 2010 05:05:29 GMT]]></title><description><![CDATA[<p>Newbie19 schrieb:</p>
<blockquote>
<p>Nochmal eine kurze Nachfrage...<br />
Wofür steht das L vor dem &quot;Test&quot; String?<br />
Weiß nämlich nicht, wie ich mir eine Antwort ergooglen könnte ^^</p>
</blockquote>
<p>Eine Zeichenkette mit dem Präfix L, wie etwa</p>
<pre><code class="language-cpp">L&quot;help&quot;
</code></pre>
<p>ist eine Zeichenkette von WideChars. Ihr Typ ist</p>
<pre><code class="language-cpp">const wchar_t[]
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1892555</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892555</guid><dc:creator><![CDATA[xote]]></dc:creator><pubDate>Wed, 05 May 2010 05:05:29 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Wed, 05 May 2010 08:01:30 GMT]]></title><description><![CDATA[<p>Ad aCTa schrieb:</p>
<blockquote>
<p>I[...]Ob man nun vor der Funktion '&amp;' schreibt oder nicht ist bei Nicht-Elementfunktion doch AFAIK egal[...]</p>
</blockquote>
<p>Nein, ist es nicht. Wie bei allen Dingen für die man eine Referenz haben will, muss man auch bei Funktionen den Referenzoperator davor schreiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892582</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892582</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Wed, 05 May 2010 08:01:30 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Wed, 05 May 2010 08:49:11 GMT]]></title><description><![CDATA[<p>Es ist ein Adressoperator, den man auch weglassen kann.</p>
<p>Wie wäre es denn mit <code>function</code> Objekten?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892603</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892603</guid><dc:creator><![CDATA[brotbernd]]></dc:creator><pubDate>Wed, 05 May 2010 08:49:11 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Wed, 05 May 2010 15:39:48 GMT]]></title><description><![CDATA[<blockquote>
<p>&gt; Nein, ist es nicht. Wie bei allen Dingen für die man eine Referenz haben will, muss man auch bei Funktionen den Referenzoperator davor schreiben.</p>
</blockquote>
<p>Ich will ja keine Referenz, sondern einen Zeiger. Und Funktionen bilden da eigentlich eine Ausnahme, wo man den Adress-Operator nicht angeben muss. In meinen anderen VS 2008-Implementierungen habe ich es auch so gemacht, und ich glaube mich zu erinnern, dass in &quot;Die C++ Programmiersprache&quot; ein ähnliches Beispiel zu finden war. Oder ich habe da noch eine gewaltige Wissenslücke gehabt. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Auf jeden Fall danke für die Hilfe!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892837</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892837</guid><dc:creator><![CDATA[Ad aCTa]]></dc:creator><pubDate>Wed, 05 May 2010 15:39:48 GMT</pubDate></item><item><title><![CDATA[Reply to Bin mal wieder blind... (STL) STL-Bug? on Wed, 05 May 2010 15:52:44 GMT]]></title><description><![CDATA[<p>Ad aCTa schrieb:</p>
<blockquote>
<p>Oder ich habe da noch eine gewaltige Wissenslücke gehabt.</p>
</blockquote>
<p>Nein, so wie Arrayausdrücke beim kleinsten Anzeichen von Gefahr in einen Zeiger umgewandelt werden, werden (lvalue-)Funktionsausdrücke ebenso implizit in Funktionszeiger umgewandelt wenn nötig (4.3). Zusätzlich wird - was hier bei make_pair eine Rolle spielt - eine Funktionsargument als Funktionszeiger deduziert (14.8.2.1/2 2. Alt).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1892842</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1892842</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Wed, 05 May 2010 15:52:44 GMT</pubDate></item></channel></rss>