From: Hans Fugal Date: Wed, 4 Mar 2015 20:42:31 +0000 (-0800) Subject: MoveWrapper::move() X-Git-Tag: v0.28.0~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d08270e6cbc374ef67b55f21beed0cfcc359d0e1;p=folly.git MoveWrapper::move() Summary: sugar providing `foo.move()` instead of `std::move(*foo)`. Test Plan: Inspection. Using it in another diff. Reviewed By: yfeldblum@fb.com, hannesr@fb.com Subscribers: trunkagent, exa, folly-diffs@, yfeldblum FB internal diff: D1882208 Signature: t1:1882208:1425331389:a9c09ad2739838c829e2afdad64e985810154226 --- diff --git a/folly/MoveWrapper.h b/folly/MoveWrapper.h index 6fbd710e..853f50ef 100644 --- a/folly/MoveWrapper.h +++ b/folly/MoveWrapper.h @@ -54,6 +54,9 @@ class MoveWrapper { const T* operator->() const { return &value; } T* operator->() { return &value; } + /// move the value out (sugar for std::move(*moveWrapper)) + T&& move() { return std::move(value); } + // If you want these you're probably doing it wrong, though they'd be // easy enough to implement MoveWrapper& operator=(MoveWrapper const&) = delete;