projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
75278c6
)
MoveWrapper::move()
author
Hans Fugal
<fugalh@fb.com>
Wed, 4 Mar 2015 20:42:31 +0000
(12:42 -0800)
committer
Sara Golemon
<sgolemon@fb.com>
Thu, 5 Mar 2015 18:22:45 +0000
(10:22 -0800)
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
patch
|
blob
|
history
diff --git
a/folly/MoveWrapper.h
b/folly/MoveWrapper.h
index 6fbd710e69ab55b75769c9af418c3a8d4458c3b6..853f50ef4255700b20ecc51b779728f7162e1e66 100644
(file)
--- 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;