Future<T>::then([](T&&)), aka next()
authorJames Sedgwick <jsedgwick@fb.com>
Wed, 29 Oct 2014 23:33:14 +0000 (16:33 -0700)
committerPavlo Kushnir <pavlo@fb.com>
Sat, 8 Nov 2014 02:07:58 +0000 (18:07 -0800)
commit449e25960a2c635eea8fe2be9a8f090dccdfcb7e
tree3d96379f94faa48f136883e578863d756aaf6c70
parent32a9723ad4951fcc8b6324c55d967c3d2f21552e
Future<T>::then([](T&&)), aka next()

Summary:
variants of then() that bypass Try and forward any exceptions up to the next future. like next() from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3865.pdf

this could go a long way towards reducing spurious rethrows wherever people don't ever actually catch exceptions in their continuations, which is probably often enough.

anyone know if there's something in folly or standard library that does what my silly VoidWrapper struct does?

there's a lot of copypasta here but i'm not sure consolidating into helpers would actually be useful considering the amount of template crap, i don't feel strongly about it though.

Test Plan: added unit

Reviewed By: hans@fb.com

Subscribers: trunkagent, sammerat, fugalh, njormrod, folly-diffs@, bmatheny

FB internal diff: D1641776

Signature: t1:1641776:1414610434:c742563b8061a748fca9292fc2765081edcf9d52
folly/wangle/Future-inl.h
folly/wangle/Future.h
folly/wangle/Try.h
folly/wangle/test/FutureTest.cpp
folly/wangle/test/Thens.cpp
folly/wangle/test/thens.rb