<?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[Problem mit dem != Operator in template Klasse]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein Problem mit dem überladenen != Operator. Irgendwie will da die Compilierung nicht funktionieren.</p>
<p>Folgende Fehlermeldung bekomme ich:</p>
<pre><code>src/Hashtable.h: In member function ‘bool Hashtable&lt;type&gt;::put(std::string, type) [with type = int]’:
src/main.cpp:41:   instantiated from here
In file included from src/main.cpp:11:
src/Hashtable.h:71: error: no match for ‘operator!=’ in ‘itr != ((Hashtable&lt;int&gt;*)this)-&gt;Hashtable&lt;int&gt;::mtable.List&lt;type&gt;::end [with type = Pair&lt;int&gt;]()’
src/List.h:45: note: candidates are: bool List&lt;type&gt;::iterator::operator!=(List&lt;type&gt;::iterator&amp;) [with type = Pair&lt;int&gt;]
</code></pre>
<p>Hier ist die Liste.h:<br />
<a href="http://codepad.org/5pXu891F" rel="nofollow">http://codepad.org/5pXu891F</a></p>
<p>Hashtable.h:<br />
<a href="http://codepad.org/bMJomSi3" rel="nofollow">http://codepad.org/bMJomSi3</a></p>
<p>Pair.h:<br />
<a href="http://codepad.org/2sGxDLIp" rel="nofollow">http://codepad.org/2sGxDLIp</a></p>
<p>ListNode.h:<br />
<a href="http://codepad.org/FUFmFeG4" rel="nofollow">http://codepad.org/FUFmFeG4</a></p>
<p>main.cpp:<br />
<a href="http://codepad.org/sWYe2xWt" rel="nofollow">http://codepad.org/sWYe2xWt</a></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/287289/problem-mit-dem-operator-in-template-klasse</link><generator>RSS for Node</generator><lastBuildDate>Thu, 20 Aug 2026 13:02:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/287289.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 25 May 2011 19:00:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit dem != Operator in template Klasse on Wed, 25 May 2011 19:00:02 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein Problem mit dem überladenen != Operator. Irgendwie will da die Compilierung nicht funktionieren.</p>
<p>Folgende Fehlermeldung bekomme ich:</p>
<pre><code>src/Hashtable.h: In member function ‘bool Hashtable&lt;type&gt;::put(std::string, type) [with type = int]’:
src/main.cpp:41:   instantiated from here
In file included from src/main.cpp:11:
src/Hashtable.h:71: error: no match for ‘operator!=’ in ‘itr != ((Hashtable&lt;int&gt;*)this)-&gt;Hashtable&lt;int&gt;::mtable.List&lt;type&gt;::end [with type = Pair&lt;int&gt;]()’
src/List.h:45: note: candidates are: bool List&lt;type&gt;::iterator::operator!=(List&lt;type&gt;::iterator&amp;) [with type = Pair&lt;int&gt;]
</code></pre>
<p>Hier ist die Liste.h:<br />
<a href="http://codepad.org/5pXu891F" rel="nofollow">http://codepad.org/5pXu891F</a></p>
<p>Hashtable.h:<br />
<a href="http://codepad.org/bMJomSi3" rel="nofollow">http://codepad.org/bMJomSi3</a></p>
<p>Pair.h:<br />
<a href="http://codepad.org/2sGxDLIp" rel="nofollow">http://codepad.org/2sGxDLIp</a></p>
<p>ListNode.h:<br />
<a href="http://codepad.org/FUFmFeG4" rel="nofollow">http://codepad.org/FUFmFeG4</a></p>
<p>main.cpp:<br />
<a href="http://codepad.org/sWYe2xWt" rel="nofollow">http://codepad.org/sWYe2xWt</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2068686</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2068686</guid><dc:creator><![CDATA[anno]]></dc:creator><pubDate>Wed, 25 May 2011 19:00:02 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit dem != Operator in template Klasse on Wed, 25 May 2011 19:04:20 GMT]]></title><description><![CDATA[<p>Bitte beschränke dich auf das Wesentlichste. Sonst schaut sich das niemand an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2068689</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2068689</guid><dc:creator><![CDATA[EOutOfResources]]></dc:creator><pubDate>Wed, 25 May 2011 19:04:20 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit dem != Operator in template Klasse on Wed, 25 May 2011 19:06:17 GMT]]></title><description><![CDATA[<p>Hier in diesem Code abschnitt tritt der Fehler auf bei der Verwendung des != Operators, alledings weiß ich nicht genau warum das nicht funktioniert.</p>
<pre><code class="language-cpp">//--------------------------------------------------

        bool put(string key, type value) {

            int hash_value;
            typename List&lt;Pair&lt;type&gt; &gt;::iterator itr;
            Pair&lt;type&gt; *pair;

            hash_value = hashcode(key);

            itr = mtable.begin();

            while(itr != mtable.end()) {

                //pair bb = *itr;                          

                //itr++;

            }  

        }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2068692</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2068692</guid><dc:creator><![CDATA[anno]]></dc:creator><pubDate>Wed, 25 May 2011 19:06:17 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit dem != Operator in template Klasse on Wed, 25 May 2011 19:08:24 GMT]]></title><description><![CDATA[<p>Mach den Parameter des <code>!=</code> -Operator in <code>Liste.h</code> zu <code>const iterator &amp;itr</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2068696</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2068696</guid><dc:creator><![CDATA[EOutOfResources]]></dc:creator><pubDate>Wed, 25 May 2011 19:08:24 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit dem != Operator in template Klasse on Wed, 25 May 2011 19:13:20 GMT]]></title><description><![CDATA[<p>EOutOfResources schrieb:</p>
<blockquote>
<p>Mach den Parameter des <code>!=</code> -Operator in <code>Liste.h</code> zu <code>const iterator &amp;itr</code> .</p>
</blockquote>
<p>Ich würde gleich kopieren, also</p>
<pre><code class="language-cpp">iterator itr
</code></pre>
<p>anno, poste lieber gleich den Code, aber weniger als 50 Zeilen. Bei externen Links schauen sich viel weniger Leute dein Problem an, zudem wird der Code nach einiger Zeit gelöscht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2068702</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2068702</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Wed, 25 May 2011 19:13:20 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit dem != Operator in template Klasse on Wed, 25 May 2011 19:13:21 GMT]]></title><description><![CDATA[<p>Du solltest dich mal mit const-correctness beschäftigen.<br />
Dein Problem liegt darin, daß begin() und end() temporäre Objekte zurückgeben und dein Vergleichsoperator eine (nicht-konstante) Referenz erwartet - d.h. es benötigt eine &quot;echte&quot; Variable und keinen temporär gültigen Wert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2068703</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2068703</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 25 May 2011 19:13:21 GMT</pubDate></item></channel></rss>