Promise<T>::makeEmpty() and Future<T>::makeEmpty()
authorYedidya Feldblum <yfeldblum@fb.com>
Wed, 5 Jul 2017 16:38:08 +0000 (09:38 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 5 Jul 2017 16:52:20 +0000 (09:52 -0700)
commitfbeb95acc305131b90693cdb782b7912cd80551d
treeef23508b507896e5bc2c5b91756be660a2b5f02d
parent70f35fe332261673129069bb6d9239c0a5e2e0cc
Promise<T>::makeEmpty() and Future<T>::makeEmpty()

Summary:
[Folly] `Promise<T>::makeEmpty()` and `Future<T>::makeEmpty()`.

These can currently be done by creating, and then moving away from, regular promises and futures. But that allocates; this is semantically equivalent but more efficient.

Differential Revision: D5368339

fbshipit-source-id: de054cfc75c701c5d39aac64d9a2949cd34b1896
folly/futures/Future-inl.h
folly/futures/Future.h
folly/futures/Promise-inl.h
folly/futures/Promise.h
folly/futures/test/FutureTest.cpp
folly/futures/test/PromiseTest.cpp