<?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[(Im)Mutable Sets]]></title><description><![CDATA[<p>Die STL Sets sind ja immutable, was manchmal etwas nervig ist. Wenn man zB. seine eigene Sortierfunkion übergibt würde man die für die Sortierung nicht benötigten Variablen gerne beschreiben können. Auf <a href="http://www.angelikalanger.com/Articles/Cuj/01.SetIterators/SetIterators.html" rel="nofollow">http://www.angelikalanger.com/Articles/Cuj/01.SetIterators/SetIterators.html</a> steht jetzt ein langer Artikel über Iterator-Adaptoren und ewig viel Code für ein simples Problem, was man einfach dadurch lösen kann, dass man die Variablen als &quot;mutable&quot; deklariert.</p>
<p>Meine Frage ist jetzt ob die Iteratormethode irgendeinen besonderen Vorteil gegenüber &quot;mutable&quot; hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/246570/im-mutable-sets</link><generator>RSS for Node</generator><lastBuildDate>Fri, 18 Sep 2026 00:24:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/246570.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 29 Jul 2009 23:22:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to (Im)Mutable Sets on Wed, 29 Jul 2009 23:22:13 GMT]]></title><description><![CDATA[<p>Die STL Sets sind ja immutable, was manchmal etwas nervig ist. Wenn man zB. seine eigene Sortierfunkion übergibt würde man die für die Sortierung nicht benötigten Variablen gerne beschreiben können. Auf <a href="http://www.angelikalanger.com/Articles/Cuj/01.SetIterators/SetIterators.html" rel="nofollow">http://www.angelikalanger.com/Articles/Cuj/01.SetIterators/SetIterators.html</a> steht jetzt ein langer Artikel über Iterator-Adaptoren und ewig viel Code für ein simples Problem, was man einfach dadurch lösen kann, dass man die Variablen als &quot;mutable&quot; deklariert.</p>
<p>Meine Frage ist jetzt ob die Iteratormethode irgendeinen besonderen Vorteil gegenüber &quot;mutable&quot; hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1751996</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1751996</guid><dc:creator><![CDATA[Caster]]></dc:creator><pubDate>Wed, 29 Jul 2009 23:22:13 GMT</pubDate></item><item><title><![CDATA[Reply to (Im)Mutable Sets on Wed, 29 Jul 2009 23:53:15 GMT]]></title><description><![CDATA[<p>Caster schrieb:</p>
<blockquote>
<p>Wenn man zB. seine eigene Sortierfunkion übergibt würde man die für die Sortierung nicht benötigten Variablen gerne beschreiben können.</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> Was? Beispiel?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1752002</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1752002</guid><dc:creator><![CDATA[BoeserBube]]></dc:creator><pubDate>Wed, 29 Jul 2009 23:53:15 GMT</pubDate></item><item><title><![CDATA[Reply to (Im)Mutable Sets on Thu, 30 Jul 2009 00:03:31 GMT]]></title><description><![CDATA[<p>In meinem Fall wars:</p>
<pre><code class="language-cpp">struct TaskPointer
{
    /*mutable */uint RefCounter;
    Task *task;

    bool operator==(const struct TaskPointer &amp;rhs) const
    {
        return task == rhs.task;
    }

    bool operator&lt;(const struct TaskPointer &amp;rhs) const
    {
        return task &lt; rhs.task;
    }
};

std::set&lt;TaskPointer&gt;;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1752006</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1752006</guid><dc:creator><![CDATA[Caster]]></dc:creator><pubDate>Thu, 30 Jul 2009 00:03:31 GMT</pubDate></item><item><title><![CDATA[Reply to (Im)Mutable Sets on Thu, 30 Jul 2009 06:39:05 GMT]]></title><description><![CDATA[<p>Caster schrieb:</p>
<blockquote>
<p>Die STL Sets sind ja immutable, was manchmal etwas nervig ist. Wenn man zB. seine eigene Sortierfunkion übergibt würde man die für die Sortierung nicht benötigten Variablen gerne beschreiben können.</p>
</blockquote>
<p>Nimm doch einfach std::map.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1752033</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1752033</guid><dc:creator><![CDATA[Sebastian Pizer]]></dc:creator><pubDate>Thu, 30 Jul 2009 06:39:05 GMT</pubDate></item><item><title><![CDATA[Reply to (Im)Mutable Sets on Thu, 30 Jul 2009 06:48:14 GMT]]></title><description><![CDATA[<p>Sicher könnte man auch maps nehmen, doch erstens ging es mir eher um einen Vergleich der beiden Lösngsmöglichkeiten und zweitens konnte ich aufgrund der verwendeten Library nur sets nehmen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1752038</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1752038</guid><dc:creator><![CDATA[Caster]]></dc:creator><pubDate>Thu, 30 Jul 2009 06:48:14 GMT</pubDate></item></channel></rss>