Commit 148df69f authored by Sargun Vohra's avatar Sargun Vohra Committed by Facebook Github Bot

Don't allow Future::onError([](exception_wrapper&){}) to compile

Summary: `Future::onError` does not work with a function that takes `exception_wrapper&`, so it should not compile. `exception_wrapper`, `const exception_wrapper&`, and `exception_wrapper&&` are unaffected.

Reviewed By: yfeldblum

Differential Revision: D5556083

fbshipit-source-id: 45d096d9fee00322eeec6b9b9b1dcbef55cced03
parent d7d34a09
...@@ -366,6 +366,7 @@ template <class T> ...@@ -366,6 +366,7 @@ template <class T>
template <class F> template <class F>
typename std::enable_if< typename std::enable_if<
!futures::detail::callableWith<F, exception_wrapper>::value && !futures::detail::callableWith<F, exception_wrapper>::value &&
!futures::detail::callableWith<F, exception_wrapper&>::value &&
!futures::detail::Extract<F>::ReturnsFuture::value, !futures::detail::Extract<F>::ReturnsFuture::value,
Future<T>>::type Future<T>>::type
Future<T>::onError(F&& func) { Future<T>::onError(F&& func) {
...@@ -398,6 +399,7 @@ template <class T> ...@@ -398,6 +399,7 @@ template <class T>
template <class F> template <class F>
typename std::enable_if< typename std::enable_if<
!futures::detail::callableWith<F, exception_wrapper>::value && !futures::detail::callableWith<F, exception_wrapper>::value &&
!futures::detail::callableWith<F, exception_wrapper&>::value &&
futures::detail::Extract<F>::ReturnsFuture::value, futures::detail::Extract<F>::ReturnsFuture::value,
Future<T>>::type Future<T>>::type
Future<T>::onError(F&& func) { Future<T>::onError(F&& func) {
......
...@@ -262,6 +262,7 @@ class Future { ...@@ -262,6 +262,7 @@ class Future {
template <class F> template <class F>
typename std::enable_if< typename std::enable_if<
!futures::detail::callableWith<F, exception_wrapper>::value && !futures::detail::callableWith<F, exception_wrapper>::value &&
!futures::detail::callableWith<F, exception_wrapper&>::value &&
!futures::detail::Extract<F>::ReturnsFuture::value, !futures::detail::Extract<F>::ReturnsFuture::value,
Future<T>>::type Future<T>>::type
onError(F&& func); onError(F&& func);
...@@ -270,6 +271,7 @@ class Future { ...@@ -270,6 +271,7 @@ class Future {
template <class F> template <class F>
typename std::enable_if< typename std::enable_if<
!futures::detail::callableWith<F, exception_wrapper>::value && !futures::detail::callableWith<F, exception_wrapper>::value &&
!futures::detail::callableWith<F, exception_wrapper&>::value &&
futures::detail::Extract<F>::ReturnsFuture::value, futures::detail::Extract<F>::ReturnsFuture::value,
Future<T>>::type Future<T>>::type
onError(F&& func); onError(F&& func);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment