<?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[...]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/317842/topic</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Jul 2026 03:18:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/317842.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 22 Jun 2013 08:22:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ... on Wed, 11 Jun 2014 22:57:39 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333265</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333265</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Wed, 11 Jun 2014 22:57:39 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 08:28:09 GMT]]></title><description><![CDATA[<p>Du kannst dir deine Implementierung erheblich erleichtern, indem du die Liste als Ring implementierst und immer 1 Knoten hast. Damit fallen alle Sonderfaelle weg.<br />
Ausserdem koenntest du alle Einfuegeoperationen bzw. Loeschoperationen ueber insert/erase implementieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333266</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333266</guid><dc:creator><![CDATA[Kellerautomat]]></dc:creator><pubDate>Sat, 22 Jun 2013 08:28:09 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 08:57:55 GMT]]></title><description><![CDATA[<p>Alle deine Konstruktoren sind nicht exception-safe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333269</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333269</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sat, 22 Jun 2013 08:57:55 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Wed, 11 Jun 2014 22:58:15 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333271</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Wed, 11 Jun 2014 22:58:15 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 09:25:57 GMT]]></title><description><![CDATA[<p>Der -- Operator deiner Iteratoen ist ein bisschen seltsam. Vor den Anfang zu iterieren ist normalerweise sowieso UB.<br />
Hier ist eine Menge doppelter Code enthalten. Ich würde mir auch noch splice-Funktionen wünschen. Die problematischen Konstruktoren wurden schon angesprochen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333274</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333274</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sat, 22 Jun 2013 09:25:57 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Wed, 11 Jun 2014 22:58:28 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333288</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Wed, 11 Jun 2014 22:58:28 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 11:15:32 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>camper schrieb:</p>
<blockquote>
<p>Vor den Anfang zu iterieren ist normalerweise sowieso UB.</p>
</blockquote>
<p>UB heißt, der Iterator darf dann sonstwohin zeigen? Bei mir zeigt <code>--list.begin()</code> auf <code>list.end()</code> . Ist das ein Problem?</p>
</blockquote>
<p>Wenn man sich drauf verlässt, dass das nicht definiert ist schon.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333292</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Sat, 22 Jun 2013 11:15:32 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 11:21:52 GMT]]></title><description><![CDATA[<p>Nathan schrieb:</p>
<blockquote>
<p>Swordfish schrieb:</p>
<blockquote>
<p>camper schrieb:</p>
<blockquote>
<p>Vor den Anfang zu iterieren ist normalerweise sowieso UB.</p>
</blockquote>
<p>UB heißt, der Iterator darf dann sonstwohin zeigen? Bei mir zeigt <code>--list.begin()</code> auf <code>list.end()</code> . Ist das ein Problem?</p>
</blockquote>
<p>Wenn man sich drauf verlässt, dass das nicht definiert ist schon.</p>
</blockquote>
<p>Das ist doch völlig in Ordnung. Nicht definiert heißt nicht, dass ein zufälliger Wert da stehen muss.<br />
Als netter Mensch könntest du aber ein assert benutzen, dass das abfängt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333295</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333295</guid><dc:creator><![CDATA[nwp3]]></dc:creator><pubDate>Sat, 22 Jun 2013 11:21:52 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Wed, 11 Jun 2014 22:58:31 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333296</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333296</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Wed, 11 Jun 2014 22:58:31 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 12:09:20 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>UB heißt doch, die Implementierung darf machen was sie will? <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="😕"
    /></p>
</blockquote>
<p>So ist es. Der Standard legt in keinster Weise fest, was passiert, das heißt das.</p>
<blockquote>
<p>Oder meinst du, der Iterator sollte in diesem Falle von -- einfach nicht bewegt werden? Oder <code>std::out_of_range</code> werfen?</p>
</blockquote>
<p>Nein, man sollte diese Semantik am Besten gar nicht berücksichtigen. Tu' einfach so, als ob das nie passiert. Das ist auch am effizientesten.</p>
<p>P.S.: Wieso new/delete und kein Allokator?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333310</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333310</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sat, 22 Jun 2013 12:09:20 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Wed, 11 Jun 2014 22:59:46 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333313</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333313</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Wed, 11 Jun 2014 22:59:46 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 12:50:59 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>Kellerautomat schrieb:</p>
<blockquote>
<p>Ausserdem koenntest du alle Einfuegeoperationen bzw. Loeschoperationen ueber insert/erase implementieren.</p>
</blockquote>
<p>Du sagst &quot;außerdem&quot;, d.h. jetzt, mit einer linearen Liste auch schon?</p>
</blockquote>
<p>Ja. Implementiere alle Einfuege/Loeschfunktionen ueber die beiden hier:</p>
<pre><code>iterator insert(const_iterator pos, const_reference value);
iterator erase(const_iterator pos);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2333326</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333326</guid><dc:creator><![CDATA[Kellerautomat]]></dc:creator><pubDate>Sat, 22 Jun 2013 12:50:59 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Wed, 11 Jun 2014 22:59:50 GMT]]></title><description><![CDATA[<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333341</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333341</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Wed, 11 Jun 2014 22:59:50 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 14:09:21 GMT]]></title><description><![CDATA[<p>Wozu braucht man die überhaupt?<br />
Wenn man festlegen will, wie der Speicher angefordert wird, kann man doch für eigene Typen operator new überladen...?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333344</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333344</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Sat, 22 Jun 2013 14:09:21 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 14:19:03 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>Sone schrieb:</p>
<blockquote>
<p>Wieso new/delete und kein Allokator?</p>
</blockquote>
<p>Apropos Allocator: der Standardtyp dafür ist ja <code>std::allocator&lt; T &gt;</code> ... Somit kann/soll(?) ich ihn nicht benutzen, um die Nodes anzulegen, sondern nur für die <code>T</code> s?</p>
</blockquote>
<p>Du musst den Allocator rebinden:</p>
<pre><code>template &lt;typename T, typename Allocator = std::allocator&lt;T&gt;&gt;
struct list
{
    typedef typename Allocator::template rebind&lt;node&gt;::other node_allocator_type;

    ...
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2333347</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333347</guid><dc:creator><![CDATA[Kellerautomat]]></dc:creator><pubDate>Sat, 22 Jun 2013 14:19:03 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 14:27:43 GMT]]></title><description><![CDATA[<p>Nathan schrieb:</p>
<blockquote>
<p>Wozu braucht man die überhaupt?<br />
Wenn man festlegen will, wie der Speicher angefordert wird, kann man doch für eigene Typen operator new überladen...?</p>
</blockquote>
<p>Verschiedene Container haben unterschiedliche optimale Allokationsstrategien.<br />
Manchmal will man Speicher vom Heap, manchmal aus einer Arena, dann aus einem dynamischen Pool ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333349</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333349</guid><dc:creator><![CDATA[Ethon]]></dc:creator><pubDate>Sat, 22 Jun 2013 14:27:43 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 14:31:43 GMT]]></title><description><![CDATA[<p>Ethon schrieb:</p>
<blockquote>
<p>Nathan schrieb:</p>
<blockquote>
<p>Wozu braucht man die überhaupt?<br />
Wenn man festlegen will, wie der Speicher angefordert wird, kann man doch für eigene Typen operator new überladen...?</p>
</blockquote>
<p>Verschiedene Container haben unterschiedliche optimale Allokationsstrategien.<br />
Manchmal will man Speicher vom Heap, manchmal aus einer Arena, dann aus einem dynamischen Pool ...</p>
</blockquote>
<p>OK, das klingt logisch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333352</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Sat, 22 Jun 2013 14:31:43 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 15:43:20 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>Habe eben begonnen alle ctors á la</p>
<pre><code class="language-cpp">explicit list_t( size_type n )
:	head(),
	tail(),
	length()
{
	if( !n )
		return;

	node_t * first_new_node;
	
	try {
		first_new_node = new node_t();
	
	} catch( std::bad_alloc ) {
	
		throw;
	
	} catch( ... ) {
	
		delete first_new_node;
		throw;
	}
	
	node_t * current_new_node = first_new_node;
	node_t * last_new_node = first_new_node;
	
	for( size_type i = n; --i; ) {
	
		try {
			current_new_node-&gt;next = new node_t();
		
		} catch( ... ) {
		
			if( !current_new_node-&gt;next ) {
			
				current_new_node = first_new_node-&gt;next;
			
				while( current_new_node ) {
			
					node_t *next_new_node = current_new_node-&gt;next;
					delete current_new_node;
					current_new_node = next_new_node;
				}
			
				delete first_new_node;

				throw;
			}
		}
		
		current_new_node-&gt;next-&gt;prev = current_node;
		last_new_node = current_new_node = current_new_node-&gt;next;
	}

	head = first_new_node;
	tail = last_new_node;
	length = n;
}
</code></pre>
<p>umzuschreiben, damit nichts mehr leckt. . o O ( Vielleicht sollt ich mir doch mal Smartpointer anseh'n <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>
</blockquote>
<p>Keine gute Idee. catch(...) throw;-Orgien sind fehleranfällig, und schwer zu lesen. Warum nicht einfach eine Basisklasse/Member verwenden, die fürs Aufräumen zuständig ist?</p>
<p>Swordfish schrieb:</p>
<blockquote>
<p>camper schrieb:</p>
<blockquote>
<p>Der -- Operator deiner Iteratoen ist ein bisschen seltsam.</p>
</blockquote>
<p>Hm. <em>Warum</em> seltsam?</p>
</blockquote>
<p>Hatte falsch gelesen. Wenn ein Iteratoreninterface benötigt wird, ist ein Dummyknoten empfehlenswert. Das geht auch noch völlig ohne Overhead, schließlich enthält das Listobjkekt ja bereits eine halben Knoten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333362</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333362</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sat, 22 Jun 2013 15:43:20 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 16:07:37 GMT]]></title><description><![CDATA[<p>Seit 8 Jahren im Forum und beschäftigt sich noch mit solch einfachen Sachen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333364</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333364</guid><dc:creator><![CDATA[lool]]></dc:creator><pubDate>Sat, 22 Jun 2013 16:07:37 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 17:50:42 GMT]]></title><description><![CDATA[<p>lool schrieb:</p>
<blockquote>
<p>Seit 8 Jahren im Forum und beschäftigt sich noch mit solch einfachen Sachen</p>
</blockquote>
<p>Dann schreib' du mal eine <code>std::list</code> -Implementation. Ich habe mich heute auch dran gesetzt, das macht viel Spaß. Und es ist nicht einfach, es elegant, effizient und ordentlich zu machen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /><br />
P.S.: AFAIK hatte Swordfish doch eine längere Pause?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333379</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333379</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sat, 22 Jun 2013 17:50:42 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sat, 22 Jun 2013 19:44:35 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>lool schrieb:</p>
<blockquote>
<p>Seit 8 Jahren im Forum und beschäftigt sich noch mit solch einfachen Sachen</p>
</blockquote>
<p>Dann schreib' du mal eine <code>std::list</code> -Implementation. Ich habe mich heute auch dran gesetzt, das macht viel Spaß. Und es ist nicht einfach, es elegant, effizient und ordentlich zu machen.</p>
</blockquote>
<p>Jeder sollte das schon einmal gemacht haben. Mit dem Zirkel-Trick und mit Exception-Safety. Unterstützung für std::allocator muss nicht sein (&quot;std STL allocators are painful to work with and lead to code bloat and sub-optimal performance&quot;), entweder nimmt man sein eigenes Allocator-Design oder gar nichts.</p>
<p>Es spricht nichts dagegen, wenn Anfänger wie Sone eine std::list implementieren. Aber nach acht Jahren ist das eigentlich überfällig, das sehe ich genauso wie lool. Ich finde die Reaktion witzig, wie der Hinweis auf Exception-Safety sofort zu try/catch geführt hat. try/catch(...)+rethrow lässt sich <strong>immer</strong> zu RAII umformen. Sollte auch fast immer gemacht werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333402</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333402</guid><dc:creator><![CDATA[haifaik]]></dc:creator><pubDate>Sat, 22 Jun 2013 19:44:35 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sun, 23 Jun 2013 21:26:38 GMT]]></title><description><![CDATA[<p>haifaik schrieb:</p>
<blockquote>
<p>Sone schrieb:</p>
<blockquote>
<p>lool schrieb:</p>
<blockquote>
<p>Seit 8 Jahren im Forum und beschäftigt sich noch mit solch einfachen Sachen</p>
</blockquote>
<p>Dann schreib' du mal eine <code>std::list</code> -Implementation. Ich habe mich heute auch dran gesetzt, das macht viel Spaß. Und es ist nicht einfach, es elegant, effizient und ordentlich zu machen.</p>
</blockquote>
<p>Jeder sollte das schon einmal gemacht haben.</p>
</blockquote>
<p>klar. Meine letzte war vor etwa einem Jahr.</p>
<blockquote>
<p>Unterstützung für std::allocator muss nicht sein (&quot;std STL allocators are painful to work with and lead to code bloat and sub-optimal performance&quot;), entweder nimmt man sein eigenes Allocator-Design oder gar nichts.</p>
</blockquote>
<p>EASTL-Fan?<br />
Es geht mir nicht darum, eine schöne Implementierung zu schreiben, sondern eine möglichst zu <code>std::list</code> äquivalente. Ich habe (AFAIK) nur wenige, kleine Änderungen zu <code>std::list</code> in meinem vorläufigen Extrakt.<br />
(Nehme ich ein eigenes Design werde ich früher oder später auf <code>allocator_traits</code> zurückgreifen, weil auch <code>std::allocator</code> verfügbar sein soll. Und dann ist ein eigenes Design auch bescheuert. Darüber hinaus habe ich mich mit Allokatoren noch nicht viel beschäftigt und sehe deswegen - als Sturkopf - nicht ein, wieso den das STL-Allokator-Design so hässlich und schmerzbringend sein soll)</p>
<blockquote>
<p>try/catch(...)+rethrow lässt sich immer zu RAII umformen.</p>
</blockquote>
<p>Dann zeige mir, wie man (ohne Performance-Verlust und mit weniger Code, was ja anscheinend das Ziel ist) dasselbe erreicht wie im Code unten.</p>
<p>Hier wäre dann eine (unvollständige) Version meiner Implementierung: <a href="http://ideone.com/rJ4sOr" rel="nofollow">http://ideone.com/rJ4sOr</a><br />
(Schade, die Formatierung ist wieder hinüber.)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333636</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333636</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sun, 23 Jun 2013 21:26:38 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sun, 23 Jun 2013 21:59:03 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">template&lt;typename Value,
         typename Alloc = std::allocator&lt;Value&gt;&gt;
class List : ListAlloc&lt;Value, Alloc&gt;
{
    using base = typename List::base;
</code></pre>
<p>?</p>
<pre><code class="language-cpp">typedef iterator const const_iterator;
</code></pre>
<p>wirklich?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333656</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333656</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sun, 23 Jun 2013 21:59:03 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sun, 23 Jun 2013 22:02:19 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<blockquote>
<p>Jeder sollte das schon einmal gemacht haben.</p>
</blockquote>
<p>klar. Meine letzte war vor etwa einem Jahr.</p>
</blockquote>
<p>Dann sollte sie ja diesmal richtig sein.</p>
<p>Sone schrieb:</p>
<blockquote>
<p>Dann zeige mir, wie man (ohne Performance-Verlust und mit weniger Code, was ja anscheinend das Ziel ist) dasselbe erreicht wie im Code unten.</p>
</blockquote>
<p>Dann mach du erstmal deine Implementierung ohne Performance-Verlust.</p>
<pre><code class="language-cpp">struct Node
        {
                Node *prev,
                     *next;

                pointer data; // WTF?
</code></pre>
<p>Die zusätzliche Indirektion bringt hier nichts und schadet nur. Warum ein Pointer?</p>
<pre><code class="language-cpp">struct node {
  node *next, // vorwärtsiterieren ist im Zweifelsfall wichtiger als
       *prev; // rückwärtsiterieren
  T data; 
}
</code></pre>
<p>Ausserdem sehe ich überall new/delete. Wenn du Allocator willst, dann musst du den auch verwenden.<br />
Tipp: &quot;Du musst den Allocator rebinden&quot; (Zitat von Kellerautomat, Seite 2)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333659</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333659</guid><dc:creator><![CDATA[haifaik]]></dc:creator><pubDate>Sun, 23 Jun 2013 22:02:19 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sun, 23 Jun 2013 22:12:12 GMT]]></title><description><![CDATA[<p>Sone hat doch mal zugegeben das er nur für die Lolz proggt, also bewußt schlecht, damit andere darüber lolen können.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333660</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333660</guid><dc:creator><![CDATA[the daily lol]]></dc:creator><pubDate>Sun, 23 Jun 2013 22:12:12 GMT</pubDate></item><item><title><![CDATA[Reply to ... on Sun, 23 Jun 2013 22:46:09 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Dann zeige mir, wie man (ohne Performance-Verlust und mit weniger Code, was ja anscheinend das Ziel ist) dasselbe erreicht wie im Code unten.</p>
</blockquote>
<p>Prinzipiell: <a href="http://ideone.com/NMRpbG" rel="nofollow">http://ideone.com/NMRpbG</a><br />
Weniger Code ist nur ein Nebeneffekt, hauptsächlich geht es um die Vorzüge von RAII: Fehlerfreies Ressourcenmanagement.</p>
<p>(Beispiel: <a href="http://ideone.com/Yfw7nm" rel="nofollow">dein Code sigsevt</a>)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2333667</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2333667</guid><dc:creator><![CDATA[haifaik]]></dc:creator><pubDate>Sun, 23 Jun 2013 22:46:09 GMT</pubDate></item></channel></rss>