For futures::retrying, detect policy type using std::result_of
authorYedidya Feldblum <yfeldblum@fb.com>
Mon, 3 Jul 2017 20:20:29 +0000 (13:20 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 3 Jul 2017 20:39:58 +0000 (13:39 -0700)
commite81cc5a08625224488b893d6509d030cf56bf45a
tree19e7da6894739f0e7f13ebcd3c5e01893cc30190
parent8bedb7e1549c4a737d3ad4d7003ab9e195cd9fd9
For futures::retrying, detect policy type using std::result_of

Summary:
[Folly] For `futures::retrying`, detect policy type using `std::result_of`.

`FOLLY_CREATE_HAS_MEMBER_FN_TRAITS` does not work in all cases. For example, it does not work with inherited members.

And it is not really what we want, anyway, which is to dispatch based on the result type of invoking the policy with a particular set of arguments. We can do that more directly using `std::result_of`. And if we did not have `std::result_of`, then we could do that with SFINAE directly.

Reviewed By: WillerZ

Differential Revision: D5361808

fbshipit-source-id: 23f969dfd6dbaaa944dc2288e70c3ea11d3398f0
folly/futures/Future-inl.h