<?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[iterator innerhalb template-Klasse verwenden]]></title><description><![CDATA[<p>Hallo zusammen!</p>
<p>Wenn ich versuche, folgenden code zu übersetzen, erhalte ich eine Fehlermeldung.<br />
Liegt wohl an der Iterator-Definition.</p>
<pre><code>template&lt;class KeyType, class ValueType&gt;
void DictionaryAsMap&lt;KeyType, ValueType&gt;::print() const
{
    map&lt;KeyType, ValueType&gt;::iterator it; // Fehler!
}
</code></pre>
<p>Was mach ich falsch? Kann mir jemand weiterhelfen?</p>
<p>Gruß heine</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/162138/iterator-innerhalb-template-klasse-verwenden</link><generator>RSS for Node</generator><lastBuildDate>Sat, 12 Sep 2026 02:27:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162138.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 15 Oct 2006 11:42:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to iterator innerhalb template-Klasse verwenden on Sun, 15 Oct 2006 11:42:50 GMT]]></title><description><![CDATA[<p>Hallo zusammen!</p>
<p>Wenn ich versuche, folgenden code zu übersetzen, erhalte ich eine Fehlermeldung.<br />
Liegt wohl an der Iterator-Definition.</p>
<pre><code>template&lt;class KeyType, class ValueType&gt;
void DictionaryAsMap&lt;KeyType, ValueType&gt;::print() const
{
    map&lt;KeyType, ValueType&gt;::iterator it; // Fehler!
}
</code></pre>
<p>Was mach ich falsch? Kann mir jemand weiterhelfen?</p>
<p>Gruß heine</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155047</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155047</guid><dc:creator><![CDATA[heine789]]></dc:creator><pubDate>Sun, 15 Oct 2006 11:42:50 GMT</pubDate></item><item><title><![CDATA[Reply to iterator innerhalb template-Klasse verwenden on Sun, 15 Oct 2006 11:47:01 GMT]]></title><description><![CDATA[<p>heine789 schrieb:</p>
<blockquote>
<p>Was mach ich falsch?</p>
</blockquote>
<p>Du sagst uns nicht wie die Fehlermeldung heißt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155050</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155050</guid><dc:creator><![CDATA[Thomas ** 0]]></dc:creator><pubDate>Sun, 15 Oct 2006 11:47:01 GMT</pubDate></item><item><title><![CDATA[Reply to iterator innerhalb template-Klasse verwenden on Sun, 15 Oct 2006 11:55:44 GMT]]></title><description><![CDATA[<p>heine789 schrieb:</p>
<blockquote>
<p>Hallo zusammen!</p>
<p>Wenn ich versuche, folgenden code zu übersetzen, erhalte ich eine Fehlermeldung.<br />
Liegt wohl an der Iterator-Definition.</p>
<pre><code>template&lt;class KeyType, class ValueType&gt;
void DictionaryAsMap&lt;KeyType, ValueType&gt;::print() const
{
    map&lt;KeyType, ValueType&gt;::iterator it; // Fehler!
}
</code></pre>
<p>Was mach ich falsch? Kann mir jemand weiterhelfen?</p>
<p>Gruß heine</p>
</blockquote>
<p>Hi,</p>
<p>Du hast vergessen typename davor zu schreiben.<br />
Es muss so aussehen:</p>
<pre><code class="language-cpp">template&lt;class KeyType, class ValueType&gt;
void DictionaryAsMap&lt;KeyType, ValueType&gt;::print() const
{
    typename map&lt;KeyType, ValueType&gt;::iterator it; // Kein Fehler! ;)
}
</code></pre>
<p>Edit: Und da fällt mir auf, das du eine const Methode schreibst, daher solltest du hier auch const_iterator verwenden sonst hast du bald danach gleich wieder einen Fehler <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>BR<br />
Vinzenz</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155056</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155056</guid><dc:creator><![CDATA[evilissimo]]></dc:creator><pubDate>Sun, 15 Oct 2006 11:55:44 GMT</pubDate></item><item><title><![CDATA[Reply to iterator innerhalb template-Klasse verwenden on Sun, 15 Oct 2006 11:55:18 GMT]]></title><description><![CDATA[<p>typename</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1155057</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1155057</guid><dc:creator><![CDATA[Stichwort]]></dc:creator><pubDate>Sun, 15 Oct 2006 11:55:18 GMT</pubDate></item></channel></rss>