From d08270e6cbc374ef67b55f21beed0cfcc359d0e1 Mon Sep 17 00:00:00 2001 From: Hans Fugal Date: Wed, 4 Mar 2015 12:42:31 -0800 Subject: [PATCH] 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 --- folly/MoveWrapper.h | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.34.1