Split SemiFuture and Future into separate types. Add BasicFuture shared between them.
authorLee Howes <lwh@fb.com>
Mon, 30 Oct 2017 21:28:33 +0000 (14:28 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 30 Oct 2017 21:48:46 +0000 (14:48 -0700)
commit46af81b61d7c026deb2735019ae991d36e7b0d39
treef8b57817f7dab50d4f14ce3c0b3e468353a57d8c
parentcceed93af6d4d4b109a2dfd05ea76bb2ac383a5f
Split SemiFuture and Future into separate types. Add BasicFuture shared between them.

Summary:
To avoid the risk of bugs caused by a Future being cast to a SemiFuture, and losing some of the properties in the process, this splits SemiFuture and Future into unrelated types, sharing a private superclass for code reuse.
 * Add BasicFuture in futures::detail
 * Make superclass privately inherited.
 * Unset executor when constructing SemiFuture from Future.

Reviewed By: yfeldblum

Differential Revision: D6177780

fbshipit-source-id: dea3116aeec0572bb973c2a561e17785199e86f2
folly/futures/Future-inl.h
folly/futures/Future.h
folly/futures/Promise.h
folly/futures/test/SemiFutureTest.cpp