Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7888: circular_buffer should support move semantics
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-01-14 12:59:03
#7888: circular_buffer should support move semantics
------------------------------------+---------------------------------------
Reporter: holmes@⦠| Owner: jano_gaspar
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: circular_buffer
Version: Boost 1.52.0 | Severity: Problem
Resolution: | Keywords: circular_buffer move emplace
------------------------------------+---------------------------------------
Comment (by holmes@â¦):
a description of the term move semantics can be found here
http://www.cprogramming.com/c++11/rvalue-references-and-move-semantics-
in-c++11.html
Here is an example of what I would like to do which works with a
std::deque :
{{{
std::deque<std::unique_ptr<int>> myQueue;
std::unique_ptr<int> myP(new int(4));
myQueue.push_back(std::move(myP)); //transfer ownership to
the queue
auto otherP = std::move(myQueue.front()); //transfer ownership back
from the queue to a new unique_ptr
myQueue.pop_front();
}}}
This doesn't work with boost::circular_buffer because there is only one
overload of push_back and it takes a const T&. I need another overload
that takes T&&.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7888#comment:2> 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:11 UTC