diff options
Diffstat (limited to 'async/src/async_impl.h')
-rw-r--r-- | async/src/async_impl.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/async/src/async_impl.h b/async/src/async_impl.h index 58f6ced..eccbc9b 100644 --- a/async/src/async_impl.h +++ b/async/src/async_impl.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #define ASYNC_IMPL_H | 19 | #define ASYNC_IMPL_H |
20 | 20 | ||
21 | #include "async.h" | 21 | #include "async.h" |
22 | #include <type_traits> | ||
22 | 23 | ||
23 | namespace Async { | 24 | namespace Async { |
24 | 25 | ||
@@ -45,6 +46,20 @@ struct prevOut { | |||
45 | using type = typename std::tuple_element<0, std::tuple<T ..., void>>::type; | 46 | using type = typename std::tuple_element<0, std::tuple<T ..., void>>::type; |
46 | }; | 47 | }; |
47 | 48 | ||
49 | template<typename T> | ||
50 | inline typename std::enable_if<!std::is_void<T>::value, void>::type | ||
51 | copyFutureValue(const Async::Future<T> &in, Async::Future<T> &out) | ||
52 | { | ||
53 | out.setValue(in.value()); | ||
54 | } | ||
55 | |||
56 | template<typename T> | ||
57 | inline typename std::enable_if<std::is_void<T>::value, void>::type | ||
58 | copyFutureValue(const Async::Future<T> &in, Async::Future<T> &out) | ||
59 | { | ||
60 | // noop | ||
61 | } | ||
62 | |||
48 | } // namespace Detail | 63 | } // namespace Detail |
49 | 64 | ||
50 | } // namespace Async | 65 | } // namespace Async |