<?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 Problem]]></title><description><![CDATA[<pre><code class="language-cpp">bool MenschlicherSpieler::anlegepruefung(const Stein &amp;s){
std::list&lt;Stein&gt;::iterator it=this-&gt;Menschpool.begin();
	while(it!=Menschpool.end()){
	if(s.getL()==it-&gt;getR() || s.getR()==it-&gt;getL())return true;//Fehler
		it++;
	}
return false;
}
</code></pre>
<p>Ich will eine Liste von &quot;Stein&quot; objekten nach einem bestimmten Stein absuchen<br />
bekomme aber diese Fehlermeldung:<br />
error: passing `const Stein' as `this' argument of `int Stein::getR()' discards qualifiers</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/147421/iterator-problem</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 05:40:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/147421.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 16 May 2006 17:18:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Iterator Problem on Tue, 16 May 2006 17:18:16 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">bool MenschlicherSpieler::anlegepruefung(const Stein &amp;s){
std::list&lt;Stein&gt;::iterator it=this-&gt;Menschpool.begin();
	while(it!=Menschpool.end()){
	if(s.getL()==it-&gt;getR() || s.getR()==it-&gt;getL())return true;//Fehler
		it++;
	}
return false;
}
</code></pre>
<p>Ich will eine Liste von &quot;Stein&quot; objekten nach einem bestimmten Stein absuchen<br />
bekomme aber diese Fehlermeldung:<br />
error: passing `const Stein' as `this' argument of `int Stein::getR()' discards qualifiers</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1059056</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1059056</guid><dc:creator><![CDATA[blizzarac]]></dc:creator><pubDate>Tue, 16 May 2006 17:18:16 GMT</pubDate></item><item><title><![CDATA[Reply to Iterator Problem on Tue, 16 May 2006 17:27:10 GMT]]></title><description><![CDATA[<p>Ich nehme an Stein::getL() und Stein::getR() sind nicht als const markiert. Damit weiss der Compiler nicht dass getL() und getR() das Objekt nicht verändern. und ein const Stein kann man nicht verändern.</p>
<pre><code class="language-cpp">class Stein {
public:
    int getL() const; // &lt;- das const hier am Ende
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1059062</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1059062</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Tue, 16 May 2006 17:27:10 GMT</pubDate></item><item><title><![CDATA[Reply to Iterator Problem on Tue, 16 May 2006 17:32:32 GMT]]></title><description><![CDATA[<p>Ja stimmt das war es thx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1059067</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1059067</guid><dc:creator><![CDATA[blizzarac]]></dc:creator><pubDate>Tue, 16 May 2006 17:32:32 GMT</pubDate></item></channel></rss>