<?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[STL list - gleiche löschen]]></title><description><![CDATA[<p>hallo,</p>
<p>ich habe eine struktur</p>
<pre><code class="language-cpp">struct mysearch
{
	int a;
};
</code></pre>
<p>nun habe ich eine Liste von mehreren solcher Elemente, und will doppelte löschen:</p>
<pre><code class="language-cpp">list&lt;mysearch&gt; suchliste;
	//(...)

	list&lt;mysearch&gt;::iterator ke;
	for( ke = suchliste.begin(); ke != suchliste.end(); ke++ )
	{		
		list&lt;mysearch&gt;::iterator b;
		b = ke;
		b++;
		for(; b!=suchliste.end(); b++)
		{
			if( equal( (*ke).a, (*b).a) )
			{
				b = suchliste.erase( b );
			}
		}		
	}
</code></pre>
<p>es ist zwar sehr unschön ( v.a. Z 7-9 , &lt;- wie kann man das besser machen ? ), aber ich denke es sollte funktionieren oder hab ich was übersehen? Tut es aber nicht:</p>
<p>Fehlermeldung<br />
&quot;list iterators incompatible&quot;</p>
<p>bitte um hilfe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>gruß<br />
eurohasi</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/226693/stl-list-gleiche-löschen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 30 Sep 2026 19:29:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/226693.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Nov 2008 18:45:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to STL list - gleiche löschen on Tue, 04 Nov 2008 18:45:44 GMT]]></title><description><![CDATA[<p>hallo,</p>
<p>ich habe eine struktur</p>
<pre><code class="language-cpp">struct mysearch
{
	int a;
};
</code></pre>
<p>nun habe ich eine Liste von mehreren solcher Elemente, und will doppelte löschen:</p>
<pre><code class="language-cpp">list&lt;mysearch&gt; suchliste;
	//(...)

	list&lt;mysearch&gt;::iterator ke;
	for( ke = suchliste.begin(); ke != suchliste.end(); ke++ )
	{		
		list&lt;mysearch&gt;::iterator b;
		b = ke;
		b++;
		for(; b!=suchliste.end(); b++)
		{
			if( equal( (*ke).a, (*b).a) )
			{
				b = suchliste.erase( b );
			}
		}		
	}
</code></pre>
<p>es ist zwar sehr unschön ( v.a. Z 7-9 , &lt;- wie kann man das besser machen ? ), aber ich denke es sollte funktionieren oder hab ich was übersehen? Tut es aber nicht:</p>
<p>Fehlermeldung<br />
&quot;list iterators incompatible&quot;</p>
<p>bitte um hilfe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>gruß<br />
eurohasi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1610228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1610228</guid><dc:creator><![CDATA[eurohasi]]></dc:creator><pubDate>Tue, 04 Nov 2008 18:45:44 GMT</pubDate></item><item><title><![CDATA[Reply to STL list - gleiche löschen on Tue, 04 Nov 2008 18:47:57 GMT]]></title><description><![CDATA[<p>du hast scheinbar die Suchfunktion nicht benutzt - genau das selbe Thema hatten wir vor wenigen Tagen:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-226137.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-226137.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1610230</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1610230</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Tue, 04 Nov 2008 18:47:57 GMT</pubDate></item></channel></rss>