Subject: [Boost-bugs] [Boost C++ Libraries] #2319: function::operator= should "move", copy assignment should have by-value argument
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-09-11 16:11:22
#2319: function::operator= should "move", copy assignment should have by-value
argument
--------------------------+-------------------------------------------------
Reporter: niels_dekker | Owner: dgregor
Type: Bugs | Status: new
Milestone: Boost 1.37.0 | Component: function
Version: Boost 1.36.0 | Severity: Problem
Keywords: |
--------------------------+-------------------------------------------------
A few days ago, I added a comment to ticket #1910 (regarding
function::swap), suggesting to have boost::function's assignment operators
calling its new ''move_assign'' member function, instead of calling
''swap''. Doing so would significantly improve its performance.
Now I think that function::operator= deserves its own ticket, especially
because the ''copy assignment'' of boost::function can be improved even
more, by having its argument passed ''by value'', instead of creating a
copy of the argument inside the body of the function. Doing so would allow
the compiler to do copy elision, when its argument is an rvalue. See also
[http://lists.boost.org/Archives/boost/2008/09/142106.php Improving the
assignment operators of various Boost types]
So please consider the attached patch.
-- Ticket URL: <http://svn.boost.org/trac/boost/ticket/2319> 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:49:58 UTC