C++11 closures don't support move-in capture. Nor does std::bind. facepalm.
Declared in <folly/MoveWrapper.h>
template<class T>
class MoveWrapper;
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3610.html
"[...]a work-around that should make people's stomach crawl: write a wrapper that performs move-on-copy, much like the deprecated auto_ptr"
Unlike auto_ptr, this doesn't require a heap allocation.
| Name | Description |
|---|---|
MoveWrapper [constructor] | Constructors |
operator= | Assignment operators |
move | move the value out (sugar for std::move(*moveWrapper)) |
operator* | Access the wrapped value. |
operator-> | Access members of the wrapped value. |
| Name | Description |
|---|---|
makeMoveWrapper | Make a MoveWrapper from the argument. Because the name "makeMoveWrapper" is already quite transparent in its intent, this will work for lvalues as if you had wrapped them in std::move. |