<?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[[ERLEDIGT] iterator und const iterator]]></title><description><![CDATA[<p>Hallo Leute,<br />
ich habe eine Suchfunktion die mir sagen soll ob und wo sich eine Koordinate mit einer ID in einer MAP befindet.</p>
<p>Diese Position soll eine zweite Funktion nutzen um eben diese Koordinate zu löschen.</p>
<p>Irgendwie bekomme ich den CAST nicht hin.</p>
<pre><code class="language-cpp">typedef std::map&lt;unsigned int,UTM, std::greater&lt;unsigned int&gt;&gt;::iterator UTM_ITERATOR;
typedef std::map&lt;unsigned int,UTM, std::greater&lt;unsigned int&gt;&gt;::const_iterator UTM_CONST_ITERATOR;

UTM_CONST_ITERATOR GEOTopology::find_coordinate_by_id(unsigned int &amp;searched_id) const{
	UTM_CONST_ITERATOR utmiterator = coordinates.find(searched_id);
	//If the coordinate id is not found, iterators (it) position is list end.
	if(coordinates.end() != utmiterator) return utmiterator;
	else return NULL;
}

void GEOTopology::remove_coordinate(unsigned int useless_id){

	//Does the coordinate id exists in the coordinate map?
	UTM_ITERATOR tmppos = (UTM_ITERATOR) find_coordinate_by_id(useless_id);
	if(NULL != tmppos) coordinates.erase(tmppos);
	else exit(1);
}
</code></pre>
<p>In Zeile 14 geht es schief. Ich weiß dass es am Funktionsflag const liegt.<br />
Ist es in diesem Fall sinnvoll den Const flag zu behalten?<br />
Vielleicht kann man es ja intelligenter lösen.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/267585/erledigt-iterator-und-const-iterator</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 11:48:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/267585.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 May 2010 20:13:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:44:32 GMT]]></title><description><![CDATA[<p>Hallo Leute,<br />
ich habe eine Suchfunktion die mir sagen soll ob und wo sich eine Koordinate mit einer ID in einer MAP befindet.</p>
<p>Diese Position soll eine zweite Funktion nutzen um eben diese Koordinate zu löschen.</p>
<p>Irgendwie bekomme ich den CAST nicht hin.</p>
<pre><code class="language-cpp">typedef std::map&lt;unsigned int,UTM, std::greater&lt;unsigned int&gt;&gt;::iterator UTM_ITERATOR;
typedef std::map&lt;unsigned int,UTM, std::greater&lt;unsigned int&gt;&gt;::const_iterator UTM_CONST_ITERATOR;

UTM_CONST_ITERATOR GEOTopology::find_coordinate_by_id(unsigned int &amp;searched_id) const{
	UTM_CONST_ITERATOR utmiterator = coordinates.find(searched_id);
	//If the coordinate id is not found, iterators (it) position is list end.
	if(coordinates.end() != utmiterator) return utmiterator;
	else return NULL;
}

void GEOTopology::remove_coordinate(unsigned int useless_id){

	//Does the coordinate id exists in the coordinate map?
	UTM_ITERATOR tmppos = (UTM_ITERATOR) find_coordinate_by_id(useless_id);
	if(NULL != tmppos) coordinates.erase(tmppos);
	else exit(1);
}
</code></pre>
<p>In Zeile 14 geht es schief. Ich weiß dass es am Funktionsflag const liegt.<br />
Ist es in diesem Fall sinnvoll den Const flag zu behalten?<br />
Vielleicht kann man es ja intelligenter lösen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902927</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902927</guid><dc:creator><![CDATA[darkfate]]></dc:creator><pubDate>Wed, 26 May 2010 21:44:32 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 20:24:41 GMT]]></title><description><![CDATA[<p>Erstelle eine weitere <code>find_coordinate_by_id</code> -Methode ohne <code>const</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902931</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902931</guid><dc:creator><![CDATA[TyRoXx]]></dc:creator><pubDate>Wed, 26 May 2010 20:24:41 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 20:50:02 GMT]]></title><description><![CDATA[<p>TyRoXx schrieb:</p>
<blockquote>
<p>Erstelle eine weitere <code>find_coordinate_by_id</code> -Methode ohne <code>const</code> .</p>
</blockquote>
<p>OK, hat sich erledigt.<br />
Jetzt sieht es so aus:</p>
<pre><code class="language-cpp">typedef std::map&lt;unsigned int,UTM, std::greater&lt;unsigned int&gt;&gt;::iterator UTM_ITERATOR;

UTM_ITERATOR GEOTopology::find_coordinate_by_id(unsigned int &amp;searched_id){
	UTM_ITERATOR utmiterator = coordinates.find(searched_id);
	//If the coordinate id is not found, iterators (it) position is list end.
	return coordinates.end() != utmiterator ? utmiterator : NULL;
}

void GEOTopology::remove_coordinate(unsigned int useless_id){

	//Does the coordinate id exists in the coordinate map?
	UTM_ITERATOR tmppos = find_coordinate_by_id(useless_id);
	(coordinates.end() != tmppos) ? coordinates.erase(tmppos) : exit(1);
}
</code></pre>
<p>Vielleicht weiß ja einer wie es mit <strong>const</strong> zu lösen wäre. Read Only Funktionen sollten ja mit const versehen sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902933</guid><dc:creator><![CDATA[darkfate]]></dc:creator><pubDate>Wed, 26 May 2010 20:50:02 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 20:46:01 GMT]]></title><description><![CDATA[<p>Mir erscheint dein gesamtes Konzept etwas merkwürdig... Warum gibst du NULL zurück? Was soll der Sinn dieser Funktion sein? Ob das Element existiert oder nicht, ist mit end bereits aussagekräftig bekannt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902939</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902939</guid><dc:creator><![CDATA[...]]></dc:creator><pubDate>Wed, 26 May 2010 20:46:01 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 20:47:43 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void GEOTopology::remove_coordinate(unsigned int useless_id)
{
    UTM_ITERATOR tmppos = coordinates.find(useless_id);

    if (coordinates.end() != tmppos) 
       coordinates.erase(tmppos);
    else 
       exit(1);
}
</code></pre>
<p>Done.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902942</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902942</guid><dc:creator><![CDATA[...]]></dc:creator><pubDate>Wed, 26 May 2010 20:47:43 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 20:52:28 GMT]]></title><description><![CDATA[<p>... schrieb:</p>
<blockquote>
<p>Mir erscheint dein gesamtes Konzept etwas merkwürdig... Warum gibst du NULL zurück? Was soll der Sinn dieser Funktion sein? Ob das Element existiert oder nicht, ist mit end bereits aussagekräftig bekannt.</p>
</blockquote>
<p>Danke für den Tipp. Du hast natürlich recht.</p>
<p>... schrieb:</p>
<blockquote>
<pre><code class="language-cpp">void GEOTopology::remove_coordinate(unsigned int useless_id)
{
    UTM_ITERATOR tmppos = coordinates.find(useless_id);

    if (coordinates.end() != tmppos) 
       coordinates.erase(tmppos);
    else 
       exit(1);
}
</code></pre>
<p>Done.</p>
</blockquote>
<p>Die Suchfunktion wird an vielen Stellen gebraucht, deswegen wollte ich sie mal auslagern..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902943</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902943</guid><dc:creator><![CDATA[darkfate]]></dc:creator><pubDate>Wed, 26 May 2010 20:52:28 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 20:54:57 GMT]]></title><description><![CDATA[<p>Warum...<br />
...akzeptierst Du in Zeile 4 search_id als Referenz?<br />
...glaubst Du, man könne Iteratoren mit NULL initialisieren oder vergleichen?<br />
...glaubst Du, man könne einen const_iterator in einen iterator konvertieren?</p>
<p>kk</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902945</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902945</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Wed, 26 May 2010 20:54:57 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 20:58:52 GMT]]></title><description><![CDATA[<p>krümelkacker schrieb:</p>
<blockquote>
<p>Warum......akzeptierst Du in Zeile 4 search_id als Referenz?</p>
</blockquote>
<p>Weil ich sie nirgendwo manipuliere. Ist das nicht ok?</p>
<p>krümelkacker schrieb:</p>
<blockquote>
<p>...glaubst Du, man könne Iteratoren mit NULL initialisieren oder vergleichen?</p>
</blockquote>
<p>Anscheinend nicht. Dank diesem Forum weiß ich es jetzt.</p>
<p>krümelkacker schrieb:</p>
<blockquote>
<p>...glaubst Du, man könne einen const_iterator in einen iterator konvertieren?</p>
</blockquote>
<p>Bisher dachte ich es. Anscheinend nicht. Den Grund wüsste ich gerne, vielleicht hat jemand dafür eine gute Begründung. Link?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902948</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902948</guid><dc:creator><![CDATA[darkfate]]></dc:creator><pubDate>Wed, 26 May 2010 20:58:52 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:05:56 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void a(int&amp; x)
{
 x = 100;
}

void b(int x)
{
 x = 200;
}

int main()
{
 int bsp = 50;
 std::cout &lt;&lt; bsp &lt;&lt; &quot;\n&quot;; // 50
 a(bsp);
 std::cout &lt;&lt; bsp &lt;&lt; &quot;\n&quot;; // 100 (Referenz bei a, Wert überschreiben)
 b(bsp);
 std::cout &lt;&lt; bsp &lt;&lt; &quot;\n&quot;; // 100 (Keine Referenz bei b, Wert bleibt erhalten)
}
</code></pre>
<p>Näheres dazu bitte selber mit Google raussuchen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902951</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902951</guid><dc:creator><![CDATA[...]]></dc:creator><pubDate>Wed, 26 May 2010 21:05:56 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:14:57 GMT]]></title><description><![CDATA[<p>Man kann das const durchaus wegcasten. Ob das standardkonform ist, weiß ich nicht. Fakt ist, dass krümelkacker unrecht hat.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;map&gt;

typedef std::map&lt;std::string, std::string&gt; TestMap;

int main()
{
	TestMap test;

	test[&quot;Test&quot;] = &quot;Ein Test!&quot;;

	TestMap::const_iterator constIt = test.find(&quot;Test&quot;);

	std::cout &lt;&lt; constIt-&gt;second &lt;&lt; std::endl;

	// Und nun machen wir aus dem const_iterator einen iterator
	TestMap::iterator *nonConstIt = reinterpret_cast&lt;TestMap::iterator *&gt;(&amp;constIt);

	(*nonConstIt)-&gt;second = &quot;Haha!&quot;;

	std::cout &lt;&lt; test[&quot;Test&quot;] &lt;&lt; std::endl;

	return 0;
}
</code></pre>
<p>Bitte nicht nachmachen. Das ist mehr als hässlich. Dient nur zur Abschreckung <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902957</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902957</guid><dc:creator><![CDATA[...]]></dc:creator><pubDate>Wed, 26 May 2010 21:14:57 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:15:34 GMT]]></title><description><![CDATA[<p>... schrieb:</p>
<blockquote>
<p>....</p>
</blockquote>
<p>In meinem Fall verändere ich ja die Variable nicht, also kann die Referenz stehen bleiben. Oder nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902958</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902958</guid><dc:creator><![CDATA[darkfate]]></dc:creator><pubDate>Wed, 26 May 2010 21:15:34 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:17:33 GMT]]></title><description><![CDATA[<p>darkfate schrieb:</p>
<blockquote>
<p>... schrieb:</p>
<blockquote>
<p>....</p>
</blockquote>
<p>In meinem Fall verändere ich ja die Variable nicht, also kann die Referenz stehen bleiben. Oder nicht?</p>
</blockquote>
<p>In dem Fall brauchst du die Referenz aber gar nicht.</p>
<p><a href="http://tutorial.schornboeck.net/referenzen.htm" rel="nofollow">http://tutorial.schornboeck.net/referenzen.htm</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902960</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902960</guid><dc:creator><![CDATA[...]]></dc:creator><pubDate>Wed, 26 May 2010 21:17:33 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:21:23 GMT]]></title><description><![CDATA[<p>... schrieb:</p>
<blockquote>
<p>....</p>
</blockquote>
<p>Dann wird aber beim Betreten der Funktion doch unnötig kopiert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902963</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902963</guid><dc:creator><![CDATA[darkfate]]></dc:creator><pubDate>Wed, 26 May 2010 21:21:23 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:23:49 GMT]]></title><description><![CDATA[<p>darkfate schrieb:</p>
<blockquote>
<p>krümelkacker schrieb:</p>
<blockquote>
<p>Warum......akzeptierst Du in Zeile 4 search_id als Referenz?</p>
</blockquote>
<p>Weil ich sie nirgendwo manipuliere. Ist das nicht ok?</p>
</blockquote>
<p>Was ist das denn für eine Logik?</p>
<p>darkfate schrieb:</p>
<blockquote>
<p>krümelkacker schrieb:</p>
<blockquote>
<p>...glaubst Du, man könne einen const_iterator in einen iterator konvertieren?</p>
</blockquote>
<p>Bisher dachte ich es. Anscheinend nicht. Den Grund wüsste ich gerne, vielleicht hat jemand dafür eine gute Begründung. Link?</p>
</blockquote>
<p>Wenn das ginge, würde die Unterscheidung zwischen iterator und const_iterator keinen Sinn machen. Dann kann ja jeder daher kommen und einen const_iterator in einen iterator verwandeln und böse Dinge anstellen. Eine interessantere Frage wäre: Warum akzeptiert die erase-Methode keinen const_iterator? Antwort: An so etwas hat man wahrscheinlich nicht gedacht beim Design.</p>
<p>kk</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902964</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902964</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Wed, 26 May 2010 21:23:49 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:23:57 GMT]]></title><description><![CDATA[<p>darkfate schrieb:</p>
<blockquote>
<p>... schrieb:</p>
<blockquote>
<p>....</p>
</blockquote>
<p>Dann wird aber beim Betreten der Funktion doch unnötig kopiert?</p>
</blockquote>
<p>Jein. Im Fall einer extrem großen Klasse, etc. wäre das sicher ein Punkt, wo man drauf achten kann. Oft wirst du daher auch im Forum const std::string&amp; str als Parameter sehen. Bei einem int ist das aber vollkommen überflüssig. Der Datentyp ist so klein. Ich bin mir nicht sicher, aber eventuell macht die Referenz es in dem Fall sogar noch langsamer <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> Also merke dir: Bei den &quot;eingebauten&quot; Datentypen macht das keinen Sinn und ist überflüssig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902965</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902965</guid><dc:creator><![CDATA[...]]></dc:creator><pubDate>Wed, 26 May 2010 21:23:57 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:25:14 GMT]]></title><description><![CDATA[<p>Das ist ein <code>int</code> , der kostet so gut wie gar nichts beim Kopieren. Außerdem verbraucht die Referenz auch Speicher und CPU-Zeit, vielleicht sogar noch mehr.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902966</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902966</guid><dc:creator><![CDATA[TyRoXx]]></dc:creator><pubDate>Wed, 26 May 2010 21:25:14 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:25:57 GMT]]></title><description><![CDATA[<p>krümelkacker schrieb:</p>
<blockquote>
<p>darkfate schrieb:</p>
<blockquote>
<p>krümelkacker schrieb:</p>
<blockquote>
<p>Warum......akzeptierst Du in Zeile 4 search_id als Referenz?</p>
</blockquote>
<p>Weil ich sie nirgendwo manipuliere. Ist das nicht ok?</p>
</blockquote>
<p>Was ist das denn für eine Logik?</p>
<p>darkfate schrieb:</p>
<blockquote>
<p>krümelkacker schrieb:</p>
<blockquote>
<p>...glaubst Du, man könne einen const_iterator in einen iterator konvertieren?</p>
</blockquote>
<p>Bisher dachte ich es. Anscheinend nicht. Den Grund wüsste ich gerne, vielleicht hat jemand dafür eine gute Begründung. Link?</p>
</blockquote>
<p>Wenn das ginge, würde die Unterscheidung zwischen iterator und const_iterator keinen Sinn machen. Dann kann ja jeder daher kommen und einen const_iterator in einen iterator verwandeln und böse Dinge anstellen. Eine interessantere Frage wäre: Warum akzeptiert die erase-Methode keinen const_iterator? Antwort: An so etwas hat man wahrscheinlich nicht gedacht beim Design.</p>
<p>kk</p>
</blockquote>
<p>Wird beim Aufruf von erase nicht der Iterator ungültig? Eventuell wird dieser überschrieben und auf end gesetzt. Ich traue den Entwicklern durchaus einiges zu und schließe daher ein Designfehler aus. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902967</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902967</guid><dc:creator><![CDATA[...]]></dc:creator><pubDate>Wed, 26 May 2010 21:25:57 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:28:17 GMT]]></title><description><![CDATA[<p>darkfate schrieb:</p>
<blockquote>
<p>... schrieb:</p>
<blockquote>
<p>....</p>
</blockquote>
<p>Dann wird aber beim Betreten der Funktion doch unnötig kopiert?</p>
</blockquote>
<p>Wir sprechen hier von einem int! Und überhaupt, wenn man bei einem nicht-trivialen benutzerdefinierten Typen das Kopieren sparen will, benutzt man Referenzen auf <strong>const</strong>:</p>
<pre><code class="language-cpp">double vector_sum(vector&lt;double&gt; const&amp; rac); // ref-auf-const
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1902969</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902969</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Wed, 26 May 2010 21:28:17 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:28:46 GMT]]></title><description><![CDATA[<p>Ok die Referenz wird entfernt. Demokratisch..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902970</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902970</guid><dc:creator><![CDATA[darkfate]]></dc:creator><pubDate>Wed, 26 May 2010 21:28:46 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:33:20 GMT]]></title><description><![CDATA[<p>Was passiert eigentlich mit der find() funktion wenn ich mehrere Werte habe? Bleibt sie beim ersten Wert stehen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902971</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902971</guid><dc:creator><![CDATA[darkfate]]></dc:creator><pubDate>Wed, 26 May 2010 21:33:20 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:35:52 GMT]]></title><description><![CDATA[<p>darkfate schrieb:</p>
<blockquote>
<p>Was passiert eigentlich mit der find() funktion wenn ich mehrere Werte habe? Bleibt sie beim ersten Wert stehen?</p>
</blockquote>
<p>Einem Key ist nur 1 Wert zugeordnet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1902972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902972</guid><dc:creator><![CDATA[TyRoXx]]></dc:creator><pubDate>Wed, 26 May 2010 21:35:52 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Wed, 26 May 2010 21:45:48 GMT]]></title><description><![CDATA[<p>TyRoXx schrieb:</p>
<blockquote>
<p>darkfate schrieb:</p>
<blockquote>
<p>Was passiert eigentlich mit der find() funktion wenn ich mehrere Werte habe? Bleibt sie beim ersten Wert stehen?</p>
</blockquote>
<p>Einem Key ist nur 1 Wert zugeordnet.</p>
</blockquote>
<p>Danke an alle Helfenden <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1902977</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1902977</guid><dc:creator><![CDATA[darkfate]]></dc:creator><pubDate>Wed, 26 May 2010 21:45:48 GMT</pubDate></item><item><title><![CDATA[Reply to [ERLEDIGT] iterator und const iterator on Thu, 27 May 2010 04:56:28 GMT]]></title><description><![CDATA[<p>... schrieb:</p>
<blockquote>
<p>Man kann das const durchaus wegcasten. [...] Fakt ist, dass krümelkacker unrecht hat.</p>
<pre><code class="language-cpp">TestMap::iterator *nonConstIt = reinterpret_cast&lt;TestMap::iterator *&gt;(&amp;constIt);
</code></pre>
</blockquote>
<p>Fakt ist, dass das nach ISO C++ Abschnitt 3.10 Absatz 15 undefiniertes Verhalten hervorruft.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1903017</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1903017</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Thu, 27 May 2010 04:56:28 GMT</pubDate></item></channel></rss>