<?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[Move-Semantik std::vector]]></title><description><![CDATA[<p>Hallo, ich stoße mit der VC++2013 ctp gerade auf folgendes Problem:</p>
<pre><code class="language-cpp">class test {
public:
	test(test &amp;&amp; other) {}
private:
	test(const test&amp; other);
};
std::vector&lt; test &gt; testvector;
</code></pre>
<pre><code>1&gt;c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(622): error C2248: 'prop::detail::dual_node::test::test' : cannot access private member declared in class 'prop::detail::dual_node::test'
</code></pre>
<p>Ersteinmal gehe ich natürlich davon aus, dass ich hier etwas falsch mache. Aber mir fällt nicht auf, inwiefern, und viele Orte gibt es ja irgendwie nicht, wo etwas schief laufen kann.<br />
Nun habe ich gelesen, dass man den move-Konstruktor explizit als noexcept angeben muss, damit vector Move-Semantik benutzen darf. Das Problem ist allerdings, dass VC++ gar kein noexcept unterstützt und throw() hilft auch nicht.</p>
<p>Wäre für Hilfe sehr dankbar!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/319686/move-semantik-std-vector</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Jul 2026 06:54:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/319686.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Aug 2013 20:20:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Move-Semantik std::vector on Wed, 28 Aug 2013 20:20:58 GMT]]></title><description><![CDATA[<p>Hallo, ich stoße mit der VC++2013 ctp gerade auf folgendes Problem:</p>
<pre><code class="language-cpp">class test {
public:
	test(test &amp;&amp; other) {}
private:
	test(const test&amp; other);
};
std::vector&lt; test &gt; testvector;
</code></pre>
<pre><code>1&gt;c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(622): error C2248: 'prop::detail::dual_node::test::test' : cannot access private member declared in class 'prop::detail::dual_node::test'
</code></pre>
<p>Ersteinmal gehe ich natürlich davon aus, dass ich hier etwas falsch mache. Aber mir fällt nicht auf, inwiefern, und viele Orte gibt es ja irgendwie nicht, wo etwas schief laufen kann.<br />
Nun habe ich gelesen, dass man den move-Konstruktor explizit als noexcept angeben muss, damit vector Move-Semantik benutzen darf. Das Problem ist allerdings, dass VC++ gar kein noexcept unterstützt und throw() hilft auch nicht.</p>
<p>Wäre für Hilfe sehr dankbar!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349099</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349099</guid><dc:creator><![CDATA[moveit]]></dc:creator><pubDate>Wed, 28 Aug 2013 20:20:58 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Wed, 28 Aug 2013 20:33:14 GMT]]></title><description><![CDATA[<p>VC++ ist der letzte Dreck auf Erden, mehr musst du nicht wissen.</p>
<blockquote>
<p>Nun habe ich gelesen, dass man den move-Konstruktor explizit als noexcept angeben muss, damit vector Move-Semantik benutzen darf.</p>
</blockquote>
<p>Nein, das ist falsch: Weder MoveAssignable noch MoveConstructible (die Konzepte die <code>vector</code> bspw. voraussetzt) fordern <code>noexcept</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349101</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349101</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Wed, 28 Aug 2013 20:33:14 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Wed, 28 Aug 2013 20:33:58 GMT]]></title><description><![CDATA[<p>Grummel, ich hab's!<br />
Irgendwie ging ich gerade nicht davon aus, dass man auch den move operator= benötigen würde -.-</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349102</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349102</guid><dc:creator><![CDATA[moveit]]></dc:creator><pubDate>Wed, 28 Aug 2013 20:33:58 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Wed, 28 Aug 2013 20:35:54 GMT]]></title><description><![CDATA[<p>moveit schrieb:</p>
<blockquote>
<p>Grummel, ich hab's!<br />
Irgendwie ging ich gerade nicht davon aus, dass man auch den move operator= benötigen würde -.-</p>
</blockquote>
<p>Ach Moment! Zeig uns doch wenigstens den Code, der die Fehlermeldung verursacht! Ich dachte, lediglich die Deklaration eines vectors mit deinem Typ würde die Fehlermeldung verursachen. Da habe ich VC++ zu Unrecht gerügt. Egal, verdient es sowieso.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349103</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349103</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Wed, 28 Aug 2013 20:35:54 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Wed, 28 Aug 2013 20:38:59 GMT]]></title><description><![CDATA[<p>Der Code da oben war genau der herunterminimierte Code, der zu der Fehlermeldung führt.<br />
Ich habe dort einfach nicht beachtet, dass vector auch MoveAssignable benötigt, was dann bei fehlendem operator= zu der Fehlermeldung führte.<br />
Wenn ich operator=(test&amp;&amp;); einbaue, dann klappt's.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349104</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349104</guid><dc:creator><![CDATA[moveit]]></dc:creator><pubDate>Wed, 28 Aug 2013 20:38:59 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Wed, 28 Aug 2013 20:43:24 GMT]]></title><description><![CDATA[<p>moveit schrieb:</p>
<blockquote>
<p>Der Code da oben war genau der herunterminimierte Code, der zu der Fehlermeldung führt.</p>
</blockquote>
<p>Dann ist VC++ doch Scheiße.</p>
<p><code>vector</code> erfordert <strong>standardmäßig</strong> nichts, schon rein aus Kompabilitätsgründen wäre das lächerlich (wie viel alter Code deklariert einen Move-Ctor?!). Nur <strong>bestimmte Operationen</strong> erfordern bestimmte Konzepte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349107</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349107</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Wed, 28 Aug 2013 20:43:24 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Wed, 28 Aug 2013 20:44:23 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>VC++ ist der letzte Dreck auf Erden, mehr musst du nicht wissen.[...]<br />
Dann ist VC++ doch Scheiße.</p>
</blockquote>
<p>Jaja, Sone. Eines Tages wirst selbst du mal über deinen kleinen Tellerrand blicken.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349108</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349108</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Wed, 28 Aug 2013 20:44:23 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Wed, 28 Aug 2013 20:49:17 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/28547">@Sone</a><br />
VS ist nicht nur C++ compiler, da steckt sehr viel mehr drin, und es ist generell ein sehr gutes tool. hast wieder mal nix kapiert. derp</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349110</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349110</guid><dc:creator><![CDATA[!derp]]></dc:creator><pubDate>Wed, 28 Aug 2013 20:49:17 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Wed, 28 Aug 2013 21:10:20 GMT]]></title><description><![CDATA[<p>Nexus schrieb:</p>
<blockquote>
<p>Sone schrieb:</p>
<blockquote>
<p>VC++ ist der letzte Dreck auf Erden, mehr musst du nicht wissen.[...]<br />
Dann ist VC++ doch Scheiße.</p>
</blockquote>
<p>Jaja, Sone. Eines Tages wirst selbst du mal über deinen kleinen Tellerrand blicken.</p>
</blockquote>
<p>Ich rede nicht von der IDE! Die IDE ist super. Der Debugger ist gut. Der Compiler ist nur doof. Wer mag denn den Compiler? Der ist furchtbar, alle finden den doof!</p>
<blockquote>
<p>VS ist nicht nur C++ compiler</p>
</blockquote>
<p>Ja, VS! Nicht VC++! VS kompensiert das ganze mehr als genug mit einer super IDE.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349112</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349112</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Wed, 28 Aug 2013 21:10:20 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Wed, 28 Aug 2013 21:05:43 GMT]]></title><description><![CDATA[<p>moveit schrieb:</p>
<blockquote>
<p>Der Code da oben war genau der herunterminimierte Code, der zu der Fehlermeldung führt.</p>
</blockquote>
<p>Microsoft (R) C/C++ Optimizing Compiler Version 18.00.20617.1 schrieb:</p>
<blockquote>
<p>1&gt;------ Rebuild All started: Project: blub, Configuration: Debug x64 ------<br />
1&gt; main.cpp<br />
1&gt; blub.vcxproj -&gt; D:\blub\x64\Debug\blub.exe<br />
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2349113</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349113</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Wed, 28 Aug 2013 21:05:43 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Wed, 28 Aug 2013 21:45:15 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<blockquote>
<p>Nun habe ich gelesen, dass man den move-Konstruktor explizit als noexcept angeben muss, damit vector Move-Semantik benutzen darf.</p>
</blockquote>
<p>Nein, das ist falsch: Weder MoveAssignable noch MoveConstructible (die Konzepte die <code>vector</code> bspw. voraussetzt) fordern <code>noexcept</code> .</p>
</blockquote>
<p>Nunja, es ist eigentlich sinnvoll copy statt move zu benutzen, um eine starke Garantie bei exceptions von push_back und emplace_back und ähnliche zu gewährleisten.</p>
<p>Beispiel:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;

class movable
{
public:
	movable() {}
	movable(movable const&amp;) {std::cout &lt;&lt; &quot;why no move?\n&quot;;}
	movable(movable&amp;&amp;) {}
	movable&amp; operator =(movable const&amp;) {std::cout &lt;&lt; &quot;why no move?\n&quot;;return *this;}
	movable&amp; operator =(movable&amp;&amp;) {return *this;}
};

int main()
{
	std::vector&lt;movable&gt; vec(3);
	vec.emplace_back();
}
</code></pre>
<p>Kompiliert mit GCC 4.8.1, -std=c++11, ausgabe:</p>
<blockquote>
<p>why no move?<br />
why no move?<br />
why no move?</p>
</blockquote>
<p>Fügt man allerdings noexcept ein, ist die Ausgabe leer. Natürlich, wenn der Type kein Kopieren unterstützt, dann wird nur move genutzt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349118</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349118</guid><dc:creator><![CDATA[Flashput]]></dc:creator><pubDate>Wed, 28 Aug 2013 21:45:15 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Thu, 29 Aug 2013 10:02:25 GMT]]></title><description><![CDATA[<p>Ich tippe mal darauf, dass die Container std::move_if_noexcept verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349160</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349160</guid><dc:creator><![CDATA[Kellerautomat]]></dc:creator><pubDate>Thu, 29 Aug 2013 10:02:25 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Thu, 29 Aug 2013 15:43:37 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<blockquote>
<p>VS ist nicht nur C++ compiler</p>
</blockquote>
<p>Ja, VS! Nicht VC++! VS kompensiert das ganze mehr als genug mit einer super IDE.</p>
</blockquote>
<p>Bitte lerne doch erst einmal, was Visual C++ überhaupt ist, bevor du dagegen stänkerst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349229</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349229</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Thu, 29 Aug 2013 15:43:37 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Thu, 29 Aug 2013 18:08:03 GMT]]></title><description><![CDATA[<p>Ihr scheint ein anderes Visual C++ zu haben als ich. Der Editor und Intellinonsense sind furchtbar. Der Debugger ist furchtbar. Die Einstellungsdialoge sind furchtbar. Die Performance ist furchtbar. Die Optik ist seit 2012 furchtbar. Die Fehlermeldungen des Compilers sind furchtbar. Die Anzeige dieser Fehlermeldungen in der IDE ist furchtbar. Die Unterstützung von C++ ist furchtbar, auch in 2013 noch. Die Unterstützung von C ist furchtbar.<br />
Also unterm Strich eine &quot;super IDE&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349250</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349250</guid><dc:creator><![CDATA[TyRoXx]]></dc:creator><pubDate>Thu, 29 Aug 2013 18:08:03 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Thu, 29 Aug 2013 18:27:36 GMT]]></title><description><![CDATA[<p>TyRoXx schrieb:</p>
<blockquote>
<p>furchtbar furchtbar furchtbar</p>
</blockquote>
<p>mimimi</p>
<p>VS ist immer noch die beste IDE für C++, besonders mit VAX. Klar, der neue Look ist nicht so toll, aber den kann man ja ändern. Wo ansonsten hast du so gute semantische Codeanalyse, Debugger oder Profiler? Arbeite mal mit Code::Blocks, dann lernst du die Bedeutung von &quot;furchtbar&quot; wirklich kennen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349255</guid><dc:creator><![CDATA[_mi_]]></dc:creator><pubDate>Thu, 29 Aug 2013 18:27:36 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Thu, 29 Aug 2013 18:48:22 GMT]]></title><description><![CDATA[<p><em>mi</em> schrieb:</p>
<blockquote>
<p>VS ist immer noch die beste IDE für C++, besonders mit VAX.</p>
</blockquote>
<p>Das wichtigste Feature, den C++ Editor, muss man von einer anderen Firma dazu kaufen. Das bestätigt natürlich die enorme Qualität von Visual C++ an sich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349259</guid><dc:creator><![CDATA[TyRoXx]]></dc:creator><pubDate>Thu, 29 Aug 2013 18:48:22 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Thu, 29 Aug 2013 19:19:25 GMT]]></title><description><![CDATA[<p>TyRoXx schrieb:</p>
<blockquote>
<p>Das wichtigste Feature, den C++ Editor, muss man von einer anderen Firma dazu kaufen. Das bestätigt natürlich die enorme Qualität von Visual C++ an sich.</p>
</blockquote>
<p>Ich brauche den Editor von VS schon seit Jahren und bin absolut zufrieden damit. Und damit bin ich ganz sicher nicht der einzige. Linux-Fanboys bleiben vielleicht besser bei ihrem Emacs und Vim. Man kann zwar damit alle möglichen Textverarbeitungsoperationen durchführen, aber etwas tatsächlich Nützliches wie Autovervollständigung oder semantische Analyse in Echtzeit muss man sich, wenn überhaupt, durch separate Tools einbauen. Von grafischem Debugger will ich gar nicht anfangen.</p>
<p>Was Leute immer vergessen, ist dass das tatsächliche Code-Schreiben nur einen Teil der Entwicklungszeit ausmacht. Dinge wie Dokumentation lesen und schreiben, Debuggen, Profilen oder Testen gehört auch dazu. Und hier unterstützt VS zumindest mich gewaltig. Aber als Boilerplatecoder braucht man diese Tools vielleicht nicht...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349271</guid><dc:creator><![CDATA[_mi_]]></dc:creator><pubDate>Thu, 29 Aug 2013 19:19:25 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Thu, 29 Aug 2013 19:36:59 GMT]]></title><description><![CDATA[<p>TyRoXx schrieb:</p>
<blockquote>
<p>Der Editor und Intellinonsense sind furchtbar.</p>
</blockquote>
<p>Der Editor ist sicher nicht der beste, aber sicher auch nicht der schlechteste...</p>
<p>TyRoXx schrieb:</p>
<blockquote>
<p>Der Debugger ist furchtbar.</p>
</blockquote>
<p>Zeig mir einen besseren C++ Debugger.</p>
<p>TyRoXx schrieb:</p>
<blockquote>
<p>Die Performance ist furchtbar.</p>
</blockquote>
<p>aha</p>
<p>TyRoXx schrieb:</p>
<blockquote>
<p>Die Optik ist seit 2012 furchtbar.</p>
</blockquote>
<p>subjektiv</p>
<p>TyRoXx schrieb:</p>
<blockquote>
<p>Die Fehlermeldungen des Compilers sind furchtbar.</p>
</blockquote>
<p>Der einzige mir bekannte Compiler, der wirklich bessere Fehlermeldungen liefert, ist clang...</p>
<p>TyRoXx schrieb:</p>
<blockquote>
<p>Die Anzeige dieser Fehlermeldungen in der IDE ist furchtbar.</p>
</blockquote>
<p>inwiefern?</p>
<p>TyRoXx schrieb:</p>
<blockquote>
<p>Die Unterstützung von C++ ist furchtbar, auch in 2013 noch.</p>
</blockquote>
<p>Gibt echt schlimmeres.</p>
<p>TyRoXx schrieb:</p>
<blockquote>
<p>Die Unterstützung von C ist furchtbar.</p>
</blockquote>
<p>Nenn mir bitte einen vernünftigen Grund, C99 zu benutzen statt C++, generell, insbesondere auf dem PC und insbesondere unter Windows...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349277</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349277</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Thu, 29 Aug 2013 19:36:59 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Thu, 29 Aug 2013 19:58:36 GMT]]></title><description><![CDATA[<p>Also bei mir Arbeit mit Eclipse (und dem GCC) kennt der nichtmals assert im Editor, das wird immer rot angestrichen und autovervollständigt wirds auch nicht. (Obwohl es legitimer C++ Code ist, der auch vom Compiler geschluckt wird).</p>
<p>Und wenn die Performance bei dir schlecht ist, dann solltest du vielleicht mal über einen neuen Rechner nachdenken. Auf meinem Quadcore mit mehr als 4 GB Ram läuft das super. (Wobei wenn ich die Klassenansicht expandiert habe und schreibe, dann arbeitet der schon sehr hart und ist langsam. Aber sobald die zu ist, alles n1)</p>
<p>Ok, die Intellisense und die Autovervollständigung hakt manchmal. Mit einer kompletten templatebasierten Library und überall auto und decltype Keywords. Alles andere geht super (und wenn nicht, wartet man ne Sekunde bis der alles geprüft hat, dann gehts).</p>
<p>Und die C++11 unterstützung muss man wenigstens nicht mit Special-Parametern wie -pthread nach zum laufen überreden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349284</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349284</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Thu, 29 Aug 2013 19:58:36 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Thu, 29 Aug 2013 20:23:27 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<blockquote>
<p>Nun habe ich gelesen, dass man den move-Konstruktor explizit als noexcept angeben muss, damit vector Move-Semantik benutzen darf.</p>
</blockquote>
<p>Nein, das ist falsch:</p>
</blockquote>
<p>So falsch ist das nicht.</p>
<p>Sone schrieb:</p>
<blockquote>
<p>Weder MoveAssignable noch MoveConstructible (die Konzepte die <code>vector</code> bspw. voraussetzt) fordern <code>noexcept</code> .</p>
</blockquote>
<p>Das stimmt, tut hier aber nichts zur Sache.</p>
<p>Kellerautomat schrieb:</p>
<blockquote>
<p>Ich tippe mal darauf, dass die Container std::move_if_noexcept verwenden.</p>
</blockquote>
<p>Richtig, std::vector&lt;&gt; verwendet std::move_if_noexcept statt std::move an einigen Stellen. Das tut es, damit z.B. vector&lt;&gt;::resize in den Fällen, <em>wo es möglich ist</em>, die &quot;strong exception guarantee&quot; geben kann. Wenn also T einen Movekonstruktor hat, der nicht noexcept ist, T dafür aber auch kopierbar ist, dann wird beim Vergrößern des Vektors doch kopiert; denn sonst könnten Daten verloren gehen, wenn ein Move-Konstruktor dabei eine Ausnahme schmeißt. Ist T nicht kopierbar, geht es ja nicht anders. Dann hat man bei resize aber auch keine starke Ausnahmesicherheit mehr.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349291</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Thu, 29 Aug 2013 20:23:27 GMT</pubDate></item><item><title><![CDATA[Reply to Move-Semantik std::vector on Fri, 30 Aug 2013 06:29:28 GMT]]></title><description><![CDATA[<p>krümelkacker schrieb:</p>
<blockquote>
<p>Sone schrieb:</p>
<blockquote>
<blockquote>
<p>Nun habe ich gelesen, dass man den move-Konstruktor explizit als noexcept angeben muss, damit vector Move-Semantik benutzen darf.</p>
</blockquote>
<p>Nein, das ist falsch:</p>
</blockquote>
<p>So falsch ist das nicht.</p>
</blockquote>
<p>Doch, denn es ging - wie du vielleicht bemerkt haben könntest - darum, ob des kompiliert. Nicht darum, ob es moved oder nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2349328</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2349328</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 30 Aug 2013 06:29:28 GMT</pubDate></item></channel></rss>