Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7276: Add move semantics
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-26 21:40:35
#7276: Add move semantics
-------------------------------+--------------------------------------------
Reporter: viboes | Owner: djowel
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: tuple
Version: Boost 1.51.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------------------
Comment (by awulkiew):
I've created experimental version of tuple supporting move-semantics here:
http://svn.boost.org/svn/boost/sandbox/tuple-move/
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:
{{{
struct wrapper
{
tuple<int> t;
};
/*...*/
wrapper w;
w = wrapper();
}}}
however in c++03 move assignment won't be used if tuple is returned from a
function by value.
{{{
tuple<int> ret_tup(int a) { return tuple<int>(a); }
/*...*/
tuple<int> t;
t = ret_tup(0); // copy in c++03
}}}
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.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7276#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC