<?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 für Templatebasiertes hash_map]]></title><description><![CDATA[<p>So - wieder ein kleines problemchen auf das ich nicht komme:</p>
<p>Folgender code:</p>
<pre><code class="language-cpp">struct HASH_FUNCTION
{
    Key 
    operator()(const Key k) const
    {        
        return k;
    }
};

template &lt;class T&gt;
struct MY_DATA
{
    T* a;
    T* b;
    T* c;
    Key key; 
};

//Member hashmap
hash_map&lt;Tra, MY_DATA&lt;T&gt;, HASH_FUNCTION&gt; m_hash_map;

template &lt;class T&gt;
IIA&lt;T&gt;::IIA()
{
        hash_map&lt;Key, MY_DATA&lt;T&gt;, HASH_FUNCTION&gt;::iterator it;

        for(it = m_hash_map.begin(); it != m_hash_map.end(); it++)
        //...
}
</code></pre>
<p>ich bekomme den iterator nicht hin. würde gerne über die map iterieren aber der compiler spuckt mir folgendes aus:</p>
<p>[code]<br />
error: expected `;' before 'it'<br />
IAA.imp:73: error: 'it' was not declared in this scope<br />
[code]</p>
<p>Wo liegt das Problem? An der Templatedefinition wieder?<br />
Was wäre eine Lösung um einen iterator zu bekommen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/220599/iterator-für-templatebasiertes-hash_map</link><generator>RSS for Node</generator><lastBuildDate>Wed, 07 Oct 2026 08:56:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/220599.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Aug 2008 14:43:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Iterator für Templatebasiertes hash_map on Mon, 18 Aug 2008 14:43:25 GMT]]></title><description><![CDATA[<p>So - wieder ein kleines problemchen auf das ich nicht komme:</p>
<p>Folgender code:</p>
<pre><code class="language-cpp">struct HASH_FUNCTION
{
    Key 
    operator()(const Key k) const
    {        
        return k;
    }
};

template &lt;class T&gt;
struct MY_DATA
{
    T* a;
    T* b;
    T* c;
    Key key; 
};

//Member hashmap
hash_map&lt;Tra, MY_DATA&lt;T&gt;, HASH_FUNCTION&gt; m_hash_map;

template &lt;class T&gt;
IIA&lt;T&gt;::IIA()
{
        hash_map&lt;Key, MY_DATA&lt;T&gt;, HASH_FUNCTION&gt;::iterator it;

        for(it = m_hash_map.begin(); it != m_hash_map.end(); it++)
        //...
}
</code></pre>
<p>ich bekomme den iterator nicht hin. würde gerne über die map iterieren aber der compiler spuckt mir folgendes aus:</p>
<p>[code]<br />
error: expected `;' before 'it'<br />
IAA.imp:73: error: 'it' was not declared in this scope<br />
[code]</p>
<p>Wo liegt das Problem? An der Templatedefinition wieder?<br />
Was wäre eine Lösung um einen iterator zu bekommen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1567002</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1567002</guid><dc:creator><![CDATA[umbro]]></dc:creator><pubDate>Mon, 18 Aug 2008 14:43:25 GMT</pubDate></item><item><title><![CDATA[Reply to Iterator für Templatebasiertes hash_map on Mon, 18 Aug 2008 14:50:35 GMT]]></title><description><![CDATA[<p>hash_map&lt;Key, MY_DATA&lt;T&gt;, HASH_FUNCTION&gt;::iterator ist ein (vom Templateparameter T) abhängiger Bezeichner. Da aus dem Kontext nicht erkennbar ist, dass dieser Bezeichner ein Typ ist, musst du dies Dem Compiler per typename sagen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1567006</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1567006</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Mon, 18 Aug 2008 14:50:35 GMT</pubDate></item><item><title><![CDATA[Reply to Iterator für Templatebasiertes hash_map on Mon, 18 Aug 2008 14:52:57 GMT]]></title><description><![CDATA[<p>ok - ich versuche mich dran weiß aber ncoh nciht wie es gehen wird mit typename <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="😞"
    /> also wie man es richtig stellt....mal sehen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1567009</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1567009</guid><dc:creator><![CDATA[umbro]]></dc:creator><pubDate>Mon, 18 Aug 2008 14:52:57 GMT</pubDate></item><item><title><![CDATA[Reply to Iterator für Templatebasiertes hash_map on Mon, 18 Aug 2008 15:24:59 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">typename hash_map&lt;Key, MY_DATA&lt;T&gt;, HASH_FUNCTION&gt;::iterator it;
</code></pre>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1567030</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1567030</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Mon, 18 Aug 2008 15:24:59 GMT</pubDate></item><item><title><![CDATA[Reply to Iterator für Templatebasiertes hash_map on Mon, 18 Aug 2008 15:27:48 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /><br />
sorry - hab genau das als erstes probiert und übersehen dass es an der stelle geklappt hat <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1567032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1567032</guid><dc:creator><![CDATA[umbro]]></dc:creator><pubDate>Mon, 18 Aug 2008 15:27:48 GMT</pubDate></item></channel></rss>