diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-10 01:55:47 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-10 01:55:47 +0000 |
commit | 6a849971a8b6a053b6733c0cc2b117aa484c15e8 (patch) | |
tree | c7bf55b9f2ce201f73ad39a0918e5c62a37fe65e /base/callback.h.pump | |
parent | 20cea59e679b5a2d46ef6aa0de71b5b29c275c86 (diff) | |
download | chromium_src-6a849971a8b6a053b6733c0cc2b117aa484c15e8.zip chromium_src-6a849971a8b6a053b6733c0cc2b117aa484c15e8.tar.gz chromium_src-6a849971a8b6a053b6733c0cc2b117aa484c15e8.tar.bz2 |
Redo r113722 - Add Pass(), which implements move semantics, to scoped_ptr, scoped_array....
Add Pass(), which implements move semantics, to scoped_ptr, scoped_array, and scoped_ptr_malloc.
This modification to the scopers implements the "moveable but not copyable" semantics that were introduced in C++11's unique_ptr<>.
With this, is now possible to use scopers as an argument type or a return type. This signifies, in the type system, transfer of ownership into a function or out of a function respectively. Calling, or returning such a function MUST use the temporary resultin
This distinction makes it possible to avoid the implicit ownership transfer issues of auto_ptr, but still allow us to have compiler enforced ownership transfer.
Also adds a Passed() helper that allows using a scoper with Bind().
BUG=96118
TEST=new unittests
Original review URL: http://codereview.chromium.org/8774032
Review URL: http://codereview.chromium.org/8897005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113922 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/callback.h.pump')
-rw-r--r-- | base/callback.h.pump | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/base/callback.h.pump b/base/callback.h.pump index 7647389..82660f3 100644 --- a/base/callback.h.pump +++ b/base/callback.h.pump @@ -291,7 +291,7 @@ class Callback<R($for ARG , [[A$(ARG)]])> : public internal::CallbackBase { return f(bind_state_.get()[[]] $if ARITY != 0 [[, ]] $for ARG , - [[a$(ARG)]]); + [[internal::CallbackForward(a$(ARG))]]); } private: |