<?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[std::string in gcc nicht move_assignable]]></title><description><![CDATA[<p>Weiß jemand, warum sich der GCC 4.9 bei std::string nicht an den Standard (<a href="http://en.cppreference.com/w/cpp/string/basic_string/operator%3D" rel="nofollow">http://en.cppreference.com/w/cpp/string/basic_string/operator%3D</a>) hält und std::string zwar move_constructable aber nicht move_assignable ist?</p>
<p>Auf dieser Seite<br />
<a href="http://en.cppreference.com/w/cpp/types/is_move_assignable" rel="nofollow">http://en.cppreference.com/w/cpp/types/is_move_assignable</a><br />
liefert der GCC das das beschriebene Ergebnis.</p>
<p>Ein MWE:</p>
<pre><code>#include&lt;string&gt;
int main(void) {
static_assert(std::is_nothrow_move_assignable&lt;BigFuryObject&gt;::value, &quot;should not fail&quot;);
}
</code></pre>
<p>bzw. <a href="http://coliru.stacked-crooked.com/a/cc36c1ac68529605" rel="nofollow">http://coliru.stacked-crooked.com/a/cc36c1ac68529605</a></p>
<p>BTW, auf clang funktioniert das.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/332025/std-string-in-gcc-nicht-move_assignable</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 12:21:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/332025.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 03 Apr 2015 18:05:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to std::string in gcc nicht move_assignable on Fri, 03 Apr 2015 18:05:45 GMT]]></title><description><![CDATA[<p>Weiß jemand, warum sich der GCC 4.9 bei std::string nicht an den Standard (<a href="http://en.cppreference.com/w/cpp/string/basic_string/operator%3D" rel="nofollow">http://en.cppreference.com/w/cpp/string/basic_string/operator%3D</a>) hält und std::string zwar move_constructable aber nicht move_assignable ist?</p>
<p>Auf dieser Seite<br />
<a href="http://en.cppreference.com/w/cpp/types/is_move_assignable" rel="nofollow">http://en.cppreference.com/w/cpp/types/is_move_assignable</a><br />
liefert der GCC das das beschriebene Ergebnis.</p>
<p>Ein MWE:</p>
<pre><code>#include&lt;string&gt;
int main(void) {
static_assert(std::is_nothrow_move_assignable&lt;BigFuryObject&gt;::value, &quot;should not fail&quot;);
}
</code></pre>
<p>bzw. <a href="http://coliru.stacked-crooked.com/a/cc36c1ac68529605" rel="nofollow">http://coliru.stacked-crooked.com/a/cc36c1ac68529605</a></p>
<p>BTW, auf clang funktioniert das.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2449052</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2449052</guid><dc:creator><![CDATA[byteboard]]></dc:creator><pubDate>Fri, 03 Apr 2015 18:05:45 GMT</pubDate></item><item><title><![CDATA[Reply to std::string in gcc nicht move_assignable on Fri, 03 Apr 2015 18:07:26 GMT]]></title><description><![CDATA[<p>Das MWE sollte so sein:</p>
<pre><code>#include&lt;string&gt;
int main(void) {
static_assert(std::is_nothrow_move_assignable&lt;std::string&gt;::value, &quot;should not fail&quot;);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2449053</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2449053</guid><dc:creator><![CDATA[byteboard]]></dc:creator><pubDate>Fri, 03 Apr 2015 18:07:26 GMT</pubDate></item><item><title><![CDATA[Reply to std::string in gcc nicht move_assignable on Fri, 03 Apr 2015 20:25:17 GMT]]></title><description><![CDATA[<p>&quot;move assignable&quot; != &quot;nothrow move assignable&quot;</p>
<p>Der Grund könnte sein, dass es bei &quot;move construction&quot; nix freizugeben gibt, bei &quot;move assignment&quot; aber u.U. schon.<br />
Der String der per &quot;move assignment&quot; einen neuen Wert zugewiesen bekommt, könnte ja Resourcen besitzen. Die müssen dann entweder dem &quot;Opfer&quot; rübergeswapped oder direkt freigegeben werden.<br />
Diese Operationen könnten man zwar vermutlich auch nothrow bekommen. Aber wenn sie es (warum auch immer) nicht sind, dann würde das wohl dazu führen dass der move op = nicht nothrow ist. Auf den move ctor hätte es aber keinen Einfluss.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2449069</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2449069</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Fri, 03 Apr 2015 20:25:17 GMT</pubDate></item><item><title><![CDATA[Reply to std::string in gcc nicht move_assignable on Fri, 03 Apr 2015 22:54:00 GMT]]></title><description><![CDATA[<p>Aber warum ist es im standard als noexcept deklariert und warum kann es der clang?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2449085</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2449085</guid><dc:creator><![CDATA[byteboard]]></dc:creator><pubDate>Fri, 03 Apr 2015 22:54:00 GMT</pubDate></item><item><title><![CDATA[Reply to std::string in gcc nicht move_assignable on Fri, 03 Apr 2015 23:55:15 GMT]]></title><description><![CDATA[<p>Im Standard ist es vermutlich mit <code>noexcept</code> markiert, weil man es <code>noexcept</code> machen kann.<br />
Was ich ja auch <s>erwähnt</s> angedeutet habe.</p>
<p>Warum es bei GCC nicht <code>noexcept</code> ist, kann ich die nicht sagen. Ich kann nur die bereits beschriebene <em>Vermutung</em> anbieten, dass es irgendwas mit der Freigabe der Resourcen zu tun hat.</p>
<p>Wenn du es genau wissen willst guck doch einfach in die Implementierung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2449095</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2449095</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Fri, 03 Apr 2015 23:55:15 GMT</pubDate></item><item><title><![CDATA[Reply to std::string in gcc nicht move_assignable on Sat, 04 Apr 2015 00:39:46 GMT]]></title><description><![CDATA[<p>Soweit ich weiß, ist der std::string im GCC immer noch einer mit COW-Optimierung (die nach dem neuen Standard quasi verboten ist) und die SSO ist noch experimentell und muss explizit aktiviert werden. Ich mag das gerade nicht komplett durchdenken, was da wann werfen kann, aber es könnte damit zu tun haben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2449103</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2449103</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sat, 04 Apr 2015 00:39:46 GMT</pubDate></item><item><title><![CDATA[Reply to std::string in gcc nicht move_assignable on Mon, 13 Apr 2015 18:34:27 GMT]]></title><description><![CDATA[<p>Das ist schon vor zwei Jahren als Bug <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58265" rel="nofollow"><strong>#58265</strong></a> gemeldet worden. Jedoch scheint es als ob hier ein Defekt vorliegt der momentan als aktives <a href="http://cplusplus.github.io/LWG/lwg-active.html#2063" rel="nofollow">LWG-issue 2063</a> behandelt wird.</p>
<p>Kurioserweise wurde das erst vor einigen Tagen angefasst. Der aktuelle working draft enthält jedoch etwas anderes als die proposed resolution:</p>
<pre><code>basic_string&amp; operator=(basic_string&amp;&amp; str)
noexcept(allocator_traits&lt;Allocator&gt;::propagate_on_container_move_assignment::value || allocator_traits&lt;Allocator&gt;::is_always_equal::value);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2450098</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2450098</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Mon, 13 Apr 2015 18:34:27 GMT</pubDate></item><item><title><![CDATA[Reply to std::string in gcc nicht move_assignable on Mon, 13 Apr 2015 20:23:03 GMT]]></title><description><![CDATA[<p>Bleibt die Frage warum std::allocator nicht &quot;is_always_equal&quot; ist.<br />
Oder hab ich da was falsch verstanden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2450107</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2450107</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Mon, 13 Apr 2015 20:23:03 GMT</pubDate></item><item><title><![CDATA[Reply to std::string in gcc nicht move_assignable on Mon, 13 Apr 2015 20:33:50 GMT]]></title><description><![CDATA[<p>Ziemlich witzig und passt soweit ich mich erinnere zum Thema:</p>
<p><a href="https://www.youtube.com/watch?v=BezbcQIuCsY" rel="nofollow">https://www.youtube.com/watch?v=BezbcQIuCsY</a></p>
<p>So um Minute 30.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2450109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2450109</guid><dc:creator><![CDATA[Jockelx]]></dc:creator><pubDate>Mon, 13 Apr 2015 20:33:50 GMT</pubDate></item></channel></rss>