summaryrefslogtreecommitdiffstats
path: root/async/src/async_impl.h
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2014-12-11 14:22:27 +0100
committerDan Vrátil <dvratil@redhat.com>2014-12-11 14:22:27 +0100
commit1aee1bda9fc81c888ad18fea107c271133dd5442 (patch)
treeffb728821a78c0bdb1ff82543b7b3c18553da1c2 /async/src/async_impl.h
parent81b8158cca02defbfce5f1d59f06f7448fb5ea57 (diff)
downloadsink-1aee1bda9fc81c888ad18fea107c271133dd5442.tar.gz
sink-1aee1bda9fc81c888ad18fea107c271133dd5442.zip
Async: change syntax of callables
We now pass our own Async::Future to each task, instead of expecting tasks to return their future. This allows us to re-use the same Future for repeated invocations, like in the Each task.
Diffstat (limited to 'async/src/async_impl.h')
-rw-r--r--async/src/async_impl.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/async/src/async_impl.h b/async/src/async_impl.h
index 46bc25d..7b5c140 100644
--- a/async/src/async_impl.h
+++ b/async/src/async_impl.h
@@ -26,7 +26,26 @@
26 26
27namespace Async { 27namespace Async {
28 28
29namespace detail {
30
31template<typename T>
32struct identity
33{
34 typedef T type;
35};
36
37template<typename T, typename Enable = void>
38struct isIterable {
39 enum { value = 0 };
40};
41
42template<typename T>
43struct isIterable<T, typename std::conditional<false, typename T::iterator, void>::type> {
44 enum { value = 1 };
45};
46
47} // namespace Detail
29 48
30} // namespace Async 49} // namespace Async
31 50
32#endif // ASYNC_IMPL_H \ No newline at end of file 51#endif // ASYNC_IMPL_H