Boost C++ Libraries: Ticket #7276: Add move semantics https://svn.boost.org/trac10/ticket/7276 <p> Boost.Tuple lack move semantics for its arguments. It should be great if it can comply with the c++11 standard when the compiler provides rvalue references and use Boost.Move otherwise. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7276 Trac 1.4.3 awulkiew Tue, 26 Feb 2013 21:40:35 GMT <link>https://svn.boost.org/trac10/ticket/7276#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7276#comment:1</guid> <description> <p> I've created experimental version of tuple supporting move-semantics here: </p> <p> <a class="ext-link" href="http://svn.boost.org/svn/boost/sandbox/tuple-move/"><span class="icon">​</span>http://svn.boost.org/svn/boost/sandbox/tuple-move/</a> </p> <p> To ensure backward compatibility I've defined copy assignment explicitly. It's possible to use tuples wrapped in classes with implicit assignment operator in c++03: </p> <pre class="wiki">struct wrapper { tuple&lt;int&gt; t; }; /*...*/ wrapper w; w = wrapper(); </pre><p> however in c++03 move assignment won't be used if tuple is returned from a function by value. </p> <pre class="wiki">tuple&lt;int&gt; ret_tup(int a) { return tuple&lt;int&gt;(a); } /*...*/ tuple&lt;int&gt; t; t = ret_tup(0); // copy in c++03 </pre><p> We could add a define check that disables mentioned explicit copy assignments. Defining it would enable moving of objects returned by value but prevent compilation of wrappers with implicit copy assignment. </p> </description> <category>Ticket</category> </item> </channel> </rss>