From 8102c2d8419f40f990ed636e721458ca0166b483 Mon Sep 17 00:00:00 2001 From: Denis Blank Date: Mon, 19 Feb 2018 00:58:45 +0100 Subject: [PATCH] Some more ideas --- include/continuable/detail/traverse-async.hpp | 1 - test/playground/test-playground.cpp | 63 +++++++++++++++++-- 2 files changed, 57 insertions(+), 7 deletions(-) diff --git a/include/continuable/detail/traverse-async.hpp b/include/continuable/detail/traverse-async.hpp index 71d58d3..08fb1f9 100644 --- a/include/continuable/detail/traverse-async.hpp +++ b/include/continuable/detail/traverse-async.hpp @@ -364,7 +364,6 @@ public: // If the traversal method returns false, we detach the // current execution context and call the visitor with the // element and a continue callable object again. - frame_->async_continue(*current, std::move(hierarchy)); } } diff --git a/test/playground/test-playground.cpp b/test/playground/test-playground.cpp index d85cc9d..378c81d 100644 --- a/test/playground/test-playground.cpp +++ b/test/playground/test-playground.cpp @@ -22,6 +22,8 @@ #include #include +#include +#include #include @@ -117,16 +119,65 @@ void some_requests() { }); } +namespace cti { +namespace detail { + +struct c {}; + +template +struct loc {}; + +struct runtime_insertion { + std::size_t begin, end; +}; + +template +struct future_result { + std::tuple result_; +}; + +template +struct static_insertion {}; + +template +struct indexer_frame { + std::tuple hierarchy_; + + template * = nullptr> + auto operator()(T&& continuable) { + } +}; + +struct result_extractor_mapper { + template >::value>* = nullptr> + auto operator()(T&& continuable) { + + } +}; + +// 0. We create the result pack from the provides values and +// the async values if those are default constructible, +// otherwise use a lazy initialization wrapper and unwrap +// the whole pack when the composition is finished. +// value -> value, single async value -> single value +// multiple async value -> tuple of async values. +// +// 1. + +} // namespace detail +} // namespace cti + int main(int, char**) { + using namespace cti::detail; + std::vector vc{1, 2, 3}; - cti::map_pack( - [](auto&& continuable) { - // ... - return 0; - }, - vc); + // std::tuple t; + // std::tuple>, c, c> loc; + + cti::map_pack([](auto&& /*continuable*/) { return 0; }, vc); return 0; }