diff --git a/include/async_promise.hpp b/include/async_promise.hpp index 1b3db1b..3fb691b 100644 --- a/include/async_promise.hpp +++ b/include/async_promise.hpp @@ -467,33 +467,33 @@ class initial_func_task final : public task }; -template +template class next_task : public task { public: - explicit next_task(task_ptr parent) - : m_parent{std::move(parent)} + explicit next_task(task_ptr prior_task) + : m_prior_task{std::move(prior_task)} {} protected: - task_ptr m_parent; + task_ptr m_prior_task; }; -template -class then_class_task final : public next_task +template +class then_class_task final : public next_task { public: template - then_class_task(task_ptr parent, Method_&& method, Class* obj) - : next_task{std::move(parent)} + then_class_task(task_ptr prior_task, Method_&& method, Class* obj) + : next_task{std::move(prior_task)} , m_method{std::forward(method)} , m_obj{obj} {} Result run() final { - return (m_obj->*m_method)(this->m_parent->run()); + return (m_obj->*m_method)(this->m_prior_task->run()); } private: @@ -502,20 +502,20 @@ class then_class_task final : public next_task }; -template -class then_class_task_void final : public next_task +template +class then_class_task_void final : public next_task { public: template - then_class_task_void(task_ptr parent, Method_&& method, Class* obj) - : next_task{std::move(parent)} + then_class_task_void(task_ptr prior_task, Method_&& method, Class* obj) + : next_task{std::move(prior_task)} , m_method{std::forward(method)} , m_obj{obj} {} Result run() final { - this->m_parent->run(); + this->m_prior_task->run(); return (m_obj->*m_method)(); } @@ -525,19 +525,19 @@ class then_class_task_void final : public next_task }; -template -class then_func_task final : public next_task +template +class then_func_task final : public next_task { public: template - then_func_task(task_ptr parent, Func_&& func) - : next_task{std::move(parent)} + then_func_task(task_ptr prior_task, Func_&& func) + : next_task{std::move(prior_task)} , m_func{std::forward(func)} {} Result run() final { - return m_func(this->m_parent->run()); + return m_func(this->m_prior_task->run()); } private: @@ -545,19 +545,19 @@ class then_func_task final : public next_task }; -template -class then_func_task_void final : public next_task +template +class then_func_task_void final : public next_task { public: template - then_func_task_void(task_ptr parent, Func_&& func) - : next_task{std::move(parent)} + then_func_task_void(task_ptr prior_task, Func_&& func) + : next_task{std::move(prior_task)} , m_func{std::forward(func)} {} Result run() final { - this->m_parent->run(); + this->m_prior_task->run(); return m_func(); } @@ -566,13 +566,13 @@ class then_func_task_void final : public next_task }; -template -class fail_class_task final : public next_task +template +class fail_class_task final : public next_task { public: template - fail_class_task(task_ptr parent, Method_&& method, Class* obj) - : next_task{std::move(parent)} + fail_class_task(task_ptr prior_task, Method_&& method, Class* obj) + : next_task{std::move(prior_task)} , m_method{std::forward(method)} , m_obj{obj} {} @@ -581,7 +581,7 @@ class fail_class_task final : public next_task { try { - return this->m_parent->run(); + return this->m_prior_task->run(); } catch(...) { @@ -595,13 +595,13 @@ class fail_class_task final : public next_task }; -template -class fail_class_task_void final : public next_task +template +class fail_class_task_void final : public next_task { public: template - fail_class_task_void(task_ptr parent, Method_&& method, Class* obj) - : next_task{std::move(parent)} + fail_class_task_void(task_ptr prior_task, Method_&& method, Class* obj) + : next_task{std::move(prior_task)} , m_method{std::forward(method)} , m_obj{obj} {} @@ -610,7 +610,7 @@ class fail_class_task_void final : public next_task { try { - return this->m_parent->run(); + return this->m_prior_task->run(); } catch(...) { @@ -624,13 +624,13 @@ class fail_class_task_void final : public next_task }; -template -class fail_func_task final : public next_task +template +class fail_func_task final : public next_task { public: template - fail_func_task(task_ptr parent, Method_&& func) - : next_task{std::move(parent)} + fail_func_task(task_ptr prior_task, Method_&& func) + : next_task{std::move(prior_task)} , m_func{std::forward(func)} {} @@ -638,7 +638,7 @@ class fail_func_task final : public next_task { try { - return this->m_parent->run(); + return this->m_prior_task->run(); } catch(...) { @@ -651,13 +651,13 @@ class fail_func_task final : public next_task }; -template -class fail_func_task_void final : public next_task +template +class fail_func_task_void final : public next_task { public: template - fail_func_task_void(task_ptr parent, Func_&& func) - : next_task{std::move(parent)} + fail_func_task_void(task_ptr prior_task, Func_&& func) + : next_task{std::move(prior_task)} , m_func{std::forward(func)} {} @@ -665,7 +665,7 @@ class fail_func_task_void final : public next_task { try { - return this->m_parent->run(); + return this->m_prior_task->run(); } catch(...) { @@ -678,13 +678,13 @@ class fail_func_task_void final : public next_task }; -template -class finally_class_task final : public next_task +template +class finally_class_task final : public next_task { public: template - finally_class_task(task_ptr parent, Method_&& method, Class* obj) - : next_task{std::move(parent)} + finally_class_task(task_ptr prior_task, Method_&& method, Class* obj) + : next_task{std::move(prior_task)} , m_method{std::forward(method)} , m_obj{obj} {} @@ -693,7 +693,7 @@ class finally_class_task final : public next_task { try { - this->m_parent->run(); + this->m_prior_task->run(); } catch(...) {} @@ -707,13 +707,13 @@ class finally_class_task final : public next_task }; -template -class finally_func_task final : public next_task +template +class finally_func_task final : public next_task { public: template - finally_func_task(task_ptr parent, Func_&& func) - : next_task{std::move(parent)} + finally_func_task(task_ptr prior_task, Func_&& func) + : next_task{std::move(prior_task)} , m_func{std::forward(func)} {} @@ -721,7 +721,7 @@ class finally_func_task final : public next_task { try { - this->m_parent->run(); + this->m_prior_task->run(); } catch(...) {} @@ -734,13 +734,13 @@ class finally_func_task final : public next_task }; -template class Container, - typename Method, typename Allocator, typename Class> -class all_class_task final : public next_task +template class Container, + typename Method, typename Alloc, typename Class> +class all_class_task final : public next_task { public: - all_class_task(task_ptr parent, Container methods, Class* obj) - : next_task{std::move(parent)} + all_class_task(task_ptr prior_task, Container methods, Class* obj) + : next_task{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} @@ -748,7 +748,7 @@ class all_class_task final : public next_task Result run() final { auto futures = vector_helper::create_vector>(m_methods.size()); - auto rv = this->m_parent->run(); + auto rv = this->m_prior_task->run(); for (auto method : m_methods) futures.push_back(std::async(std::launch::async, std::move(method), m_obj, rv)); @@ -761,19 +761,19 @@ class all_class_task final : public next_task } private: - Container m_methods; + Container m_methods; Class* const m_obj; }; -template class Container, - typename Method, typename Allocator, typename Class> -class all_class_task final - : public next_task +template class Container, + typename Method, typename Alloc, typename Class> +class all_class_task final + : public next_task { public: - all_class_task(task_ptr parent, Container methods, Class* obj) - : next_task{std::move(parent)} + all_class_task(task_ptr prior_task, Container methods, Class* obj) + : next_task{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} @@ -781,7 +781,7 @@ class all_class_task fi void run() final { auto futures = vector_helper::create_vector>(m_methods.size()); - auto rv = this->m_parent->run(); + auto rv = this->m_prior_task->run(); for (auto method : m_methods) futures.push_back(std::async(std::launch::async, std::move(method), m_obj, rv)); for (auto& future : futures) @@ -789,18 +789,18 @@ class all_class_task fi } private: - Container m_methods; + Container m_methods; Class* const m_obj; }; -template class Container, typename Method, typename Allocator, typename Class> -class all_class_task_void final : public next_task +template class Container, typename Method, typename Alloc, typename Class> +class all_class_task_void final : public next_task { public: - all_class_task_void(task_ptr parent, Container methods, Class* obj) - : next_task{std::move(parent)} + all_class_task_void(task_ptr prior_task, Container methods, Class* obj) + : next_task{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} @@ -808,7 +808,7 @@ class all_class_task_void final : public next_task Result run() final { auto futures = vector_helper::create_vector>(m_methods.size()); - this->m_parent->run(); + this->m_prior_task->run(); for (auto method : m_methods) futures.push_back(std::async(std::launch::async, std::move(method), m_obj)); @@ -821,19 +821,19 @@ class all_class_task_void final : public next_task } private: - Container m_methods; + Container m_methods; Class* const m_obj; }; -template class Container, - typename Method, typename Allocator, typename Class> -class all_class_task_void final - : public next_task +template class Container, + typename Method, typename Alloc, typename Class> +class all_class_task_void final + : public next_task { public: - all_class_task_void(task_ptr parent, Container methods, Class* obj) - : next_task{std::move(parent)} + all_class_task_void(task_ptr prior_task, Container methods, Class* obj) + : next_task{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} @@ -841,7 +841,7 @@ class all_class_task_void>(m_methods.size()); - this->m_parent->run(); + this->m_prior_task->run(); for (auto method : m_methods) futures.push_back(std::async(std::launch::async, std::move(method), m_obj)); for (auto& future : futures) @@ -849,25 +849,25 @@ class all_class_task_void m_methods; + Container m_methods; Class* const m_obj; }; -template class Container, typename Func, typename Allocator> -class all_func_task final : public next_task +template class Container, typename Func, typename Alloc> +class all_func_task final : public next_task { public: - all_func_task(task_ptr parent, Container funcs) - : next_task{std::move(parent)} + all_func_task(task_ptr prior_task, Container funcs) + : next_task{std::move(prior_task)} , m_funcs{std::move(funcs)} {} Result run() final { auto futures = vector_helper::create_vector>(m_funcs.size()); - auto rv = this->m_parent->run(); + auto rv = this->m_prior_task->run(); for (auto func : m_funcs) futures.push_back(std::async(std::launch::async, std::move(func), rv)); @@ -880,23 +880,23 @@ class all_func_task final : public next_task } private: - Container m_funcs; + Container m_funcs; }; -template class Container, typename Func, typename Allocator> -class all_func_task final : public next_task +template class Container, typename Func, typename Alloc> +class all_func_task final : public next_task { public: - all_func_task(task_ptr parent, Container funcs) - : next_task{std::move(parent)} + all_func_task(task_ptr prior_task, Container funcs) + : next_task{std::move(prior_task)} , m_funcs{std::move(funcs)} {} void run() final { auto futures = vector_helper::create_vector>(m_funcs.size()); - auto rv = this->m_parent->run(); + auto rv = this->m_prior_task->run(); for (auto func : m_funcs) futures.push_back(std::async(std::launch::async, std::move(func), rv)); for (auto& future : futures) @@ -904,24 +904,24 @@ class all_func_task final : publ } private: - Container m_funcs; + Container m_funcs; }; -template class Container, typename Func, typename Allocator> -class all_func_task_void final : public next_task +template class Container, typename Func, typename Alloc> +class all_func_task_void final : public next_task { public: - all_func_task_void(task_ptr parent, Container funcs) - : next_task{std::move(parent)} + all_func_task_void(task_ptr prior_task, Container funcs) + : next_task{std::move(prior_task)} , m_funcs{std::move(funcs)} {} Result run() final { auto futures = vector_helper::create_vector>(m_funcs.size()); - this->m_parent->run(); + this->m_prior_task->run(); for (auto func : m_funcs) futures.push_back(std::async(std::launch::async, std::move(func))); @@ -934,23 +934,23 @@ class all_func_task_void final : public next_task } private: - Container m_funcs; + Container m_funcs; }; -template class Container, typename Func, typename Allocator> -class all_func_task_void final : public next_task +template class Container, typename Func, typename Alloc> +class all_func_task_void final : public next_task { public: - all_func_task_void(task_ptr parent, Container funcs) - : next_task{std::move(parent)} + all_func_task_void(task_ptr prior_task, Container funcs) + : next_task{std::move(prior_task)} , m_funcs{std::move(funcs)} {} void run() final { auto futures = vector_helper::create_vector>(m_funcs.size()); - this->m_parent->run(); + this->m_prior_task->run(); for (auto func : m_funcs) futures.push_back(std::async(std::launch::async, std::move(func))); for (auto& future : futures) @@ -958,17 +958,17 @@ class all_func_task_void final : } private: - Container m_funcs; + Container m_funcs; }; -template class Container, typename Method, typename Allocator, typename Class> -class all_settled_class_task final : public next_task +template class Container, typename Method, typename Alloc, typename Class> +class all_settled_class_task final : public next_task { public: - all_settled_class_task(task_ptr parent, Container methods, Class* obj) - : next_task{std::move(parent)} + all_settled_class_task(task_ptr prior_task, Container methods, Class* obj) + : next_task{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} @@ -976,7 +976,7 @@ class all_settled_class_task final : public next_task Result run() final { auto futures = vector_helper::create_vector>(m_methods.size()); - auto rv = this->m_parent->run(); + auto rv = this->m_prior_task->run(); for (auto method : m_methods) futures.push_back(std::async(std::launch::async, std::move(method), m_obj, rv)); @@ -999,19 +999,19 @@ class all_settled_class_task final : public next_task } private: - Container m_methods; + Container m_methods; Class* const m_obj; }; -template class Container, typename Method, typename Allocator, typename Class> -class all_settled_class_task final - : public next_task +template class Container, typename Method, typename Alloc, typename Class> +class all_settled_class_task final + : public next_task { public: - all_settled_class_task(task_ptr parent, Container methods, Class* obj) - : next_task{std::move(parent)} + all_settled_class_task(task_ptr prior_task, Container methods, Class* obj) + : next_task{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} @@ -1019,7 +1019,7 @@ class all_settled_class_task>(m_methods.size()); - auto rv = this->m_parent->run(); + auto rv = this->m_prior_task->run(); for (auto method : m_methods) futures.push_back(std::async(std::launch::async, std::move(method), m_obj, rv)); @@ -1043,18 +1043,18 @@ class all_settled_class_task m_methods; + Container m_methods; Class* const m_obj; }; -template class Container, typename Method, typename Allocator, typename Class> -class all_settled_class_task_void final : public next_task +template class Container, typename Method, typename Alloc, typename Class> +class all_settled_class_task_void final : public next_task { public: - all_settled_class_task_void(task_ptr parent, Container methods, Class* obj) - : next_task{std::move(parent)} + all_settled_class_task_void(task_ptr prior_task, Container methods, Class* obj) + : next_task{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} @@ -1062,7 +1062,7 @@ class all_settled_class_task_void final : public next_task Result run() final { auto futures = vector_helper::create_vector>(m_methods.size()); - this->m_parent->run(); + this->m_prior_task->run(); for (auto method : m_methods) futures.push_back(std::async(std::launch::async, std::move(method), m_obj)); @@ -1085,19 +1085,19 @@ class all_settled_class_task_void final : public next_task } private: - Container m_methods; + Container m_methods; Class* const m_obj; }; -template class Container, typename Method, typename Allocator, typename Class> -class all_settled_class_task_void final - : public next_task +template class Container, typename Method, typename Alloc, typename Class> +class all_settled_class_task_void final + : public next_task { public: - all_settled_class_task_void(task_ptr parent, Container methods, Class* obj) - : next_task{std::move(parent)} + all_settled_class_task_void(task_ptr prior_task, Container methods, Class* obj) + : next_task{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} @@ -1105,7 +1105,7 @@ class all_settled_class_task_void>(m_methods.size()); - this->m_parent->run(); + this->m_prior_task->run(); for (auto method : m_methods) futures.push_back(std::async(std::launch::async, std::move(method), m_obj)); @@ -1129,25 +1129,25 @@ class all_settled_class_task_void m_methods; + Container m_methods; Class* const m_obj; }; -template class Container, typename Func, typename Allocator> -class all_settled_func_task final : public next_task +template class Container, typename Func, typename Alloc> +class all_settled_func_task final : public next_task { public: - all_settled_func_task(task_ptr parent, Container funcs) - : next_task{std::move(parent)} + all_settled_func_task(task_ptr prior_task, Container funcs) + : next_task{std::move(prior_task)} , m_funcs{std::move(funcs)} {} Result run() final { auto futures = vector_helper::create_vector>(m_funcs.size()); - auto rv = this->m_parent->run(); + auto rv = this->m_prior_task->run(); for (auto func : m_funcs) futures.push_back(std::async(std::launch::async, std::move(func), rv)); @@ -1170,25 +1170,25 @@ class all_settled_func_task final : public next_task } private: - Container m_funcs; + Container m_funcs; }; -template class Container, typename Func, typename Allocator> -class all_settled_func_task final - : public next_task +template class Container, typename Func, typename Alloc> +class all_settled_func_task final + : public next_task { public: - all_settled_func_task(task_ptr parent, Container funcs) - : next_task{std::move(parent)} + all_settled_func_task(task_ptr prior_task, Container funcs) + : next_task{std::move(prior_task)} , m_funcs{std::move(funcs)} {} Result run() final { auto futures = vector_helper::create_vector>(m_funcs.size()); - auto rv = this->m_parent->run(); + auto rv = this->m_prior_task->run(); for (auto func : m_funcs) futures.push_back(std::async(std::launch::async, std::move(func), rv)); @@ -1212,24 +1212,24 @@ class all_settled_func_task m_funcs; + Container m_funcs; }; -template class Container, typename Func, typename Allocator> -class all_settled_func_task_void final : public next_task +template class Container, typename Func, typename Alloc> +class all_settled_func_task_void final : public next_task { public: - all_settled_func_task_void(task_ptr parent, Container funcs) - : next_task{std::move(parent)} + all_settled_func_task_void(task_ptr prior_task, Container funcs) + : next_task{std::move(prior_task)} , m_funcs{std::move(funcs)} {} Result run() final { auto futures = vector_helper::create_vector>(m_funcs.size()); - this->m_parent->run(); + this->m_prior_task->run(); for (auto func : m_funcs) futures.push_back(std::async(std::launch::async, std::move(func))); @@ -1252,25 +1252,25 @@ class all_settled_func_task_void final : public next_task } private: - Container m_funcs; + Container m_funcs; }; -template class Container, typename Func, typename Allocator> -class all_settled_func_task_void final - : public next_task +template class Container, typename Func, typename Alloc> +class all_settled_func_task_void final + : public next_task { public: - all_settled_func_task_void(task_ptr parent, Container funcs) - : next_task{std::move(parent)} + all_settled_func_task_void(task_ptr prior_task, Container funcs) + : next_task{std::move(prior_task)} , m_funcs{std::move(funcs)} {} Result run() final { auto futures = vector_helper::create_vector>(m_funcs.size()); - this->m_parent->run(); + this->m_prior_task->run(); for (auto func : m_funcs) futures.push_back(std::async(std::launch::async, std::move(func))); @@ -1294,16 +1294,16 @@ class all_settled_func_task_void m_funcs; + Container m_funcs; }; -template -class any_task_base : public iterable_base, public next_task +template +class any_task_base : public iterable_base, public next_task { public: - any_task_base(task_ptr parent) - : next_task{std::move(parent)} + any_task_base(task_ptr prior_task) + : next_task{std::move(prior_task)} {} Result run() final @@ -1334,26 +1334,26 @@ class any_task_base : public iterable_base, public next_task class Container, - typename Method, typename Allocator, typename Class> +template class Container, + typename Method, typename Alloc, typename Class> class any_class_task final - : public any_task_base, Result, ParentResult> + : public any_task_base, Result, PriorResult> { public: - any_class_task(task_ptr parent, Container methods, Class* obj) - : any_task_base{std::move(parent)} + any_class_task(task_ptr prior_task, Container methods, Class* obj) + : any_task_base{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} void async_run(std::vector>& futures) { - auto arg = this->m_parent->run(); + auto arg = this->m_prior_task->run(); for (auto method : m_methods) futures.push_back(std::async(std::launch::async, &any_class_task::call, this, std::move(method), arg)); } - void call(Method method, ParentResult arg) + void call(Method method, PriorResult arg) { try { @@ -1371,31 +1371,31 @@ class any_class_task final } private: - Container m_methods; + Container m_methods; Class* m_obj; }; -template class Container, - typename Method, typename Allocator, typename Class> -class any_class_task final - : public any_task_base, void, ParentResult> +template class Container, + typename Method, typename Alloc, typename Class> +class any_class_task final + : public any_task_base, void, PriorResult> { public: - any_class_task(task_ptr parent, Container methods, Class* obj) - : any_task_base{std::move(parent)} + any_class_task(task_ptr prior_task, Container methods, Class* obj) + : any_task_base{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} void async_run(std::vector>& futures) { - auto arg = this->m_parent->run(); + auto arg = this->m_prior_task->run(); for (auto method : m_methods) futures.push_back(std::async(std::launch::async, &any_class_task::call, this, std::move(method), arg)); } - void call(Method method, ParentResult arg) + void call(Method method, PriorResult arg) { try { @@ -1414,26 +1414,26 @@ class any_class_task fi } private: - Container m_methods; + Container m_methods; Class* m_obj; }; -template class Container, - typename Method, typename Allocator, typename Class> +template class Container, + typename Method, typename Alloc, typename Class> class any_class_task_void final - : public any_task_base, Result, ParentResult> + : public any_task_base, Result, PriorResult> { public: - any_class_task_void(task_ptr parent, Container methods, Class* obj) - : any_task_base{std::move(parent)} + any_class_task_void(task_ptr prior_task, Container methods, Class* obj) + : any_task_base{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} void async_run(std::vector>& futures) { - this->m_parent->run(); + this->m_prior_task->run(); for (auto method : m_methods) futures.push_back(std::async(std::launch::async, &any_class_task_void::call, this, std::move(method))); } @@ -1456,26 +1456,26 @@ class any_class_task_void final } private: - Container m_methods; + Container m_methods; Class* m_obj; }; -template class Container, - typename Method, typename Allocator, typename Class> -class any_class_task_void final - : public any_task_base, void, ParentResult> +template class Container, + typename Method, typename Alloc, typename Class> +class any_class_task_void final + : public any_task_base, void, PriorResult> { public: - any_class_task_void(task_ptr parent, Container methods, Class* obj) - : any_task_base{std::move(parent)} + any_class_task_void(task_ptr prior_task, Container methods, Class* obj) + : any_task_base{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} void async_run(std::vector>& futures) { - this->m_parent->run(); + this->m_prior_task->run(); for (auto method : m_methods) futures.push_back(std::async(std::launch::async, &any_class_task_void::call, this, std::move(method))); } @@ -1499,30 +1499,30 @@ class any_class_task_void m_methods; + Container m_methods; Class* m_obj; }; -template class Container, typename Func, typename Allocator> +template class Container, typename Func, typename Alloc> class any_func_task final - : public any_task_base, Result, ParentResult> + : public any_task_base, Result, PriorResult> { public: - any_func_task(task_ptr parent, Container funcs) - : any_task_base{std::move(parent)} + any_func_task(task_ptr prior_task, Container funcs) + : any_task_base{std::move(prior_task)} , m_funcs{std::move(funcs)} {} void async_run(std::vector>& futures) { - auto arg = this->m_parent->run(); + auto arg = this->m_prior_task->run(); for (auto func : m_funcs) futures.push_back(std::async(std::launch::async, &any_func_task::call, this, std::move(func), arg)); } - void call(Func func, ParentResult arg) + void call(Func func, PriorResult arg) { try { @@ -1540,28 +1540,28 @@ class any_func_task final } private: - Container m_funcs; + Container m_funcs; }; -template class Container, typename Func, typename Allocator> -class any_func_task final - : public any_task_base, void, ParentResult> +template class Container, typename Func, typename Alloc> +class any_func_task final + : public any_task_base, void, PriorResult> { public: - any_func_task(task_ptr parent, Container funcs) - : any_task_base{std::move(parent)} + any_func_task(task_ptr prior_task, Container funcs) + : any_task_base{std::move(prior_task)} , m_funcs{std::move(funcs)} {} void async_run(std::vector>& futures) { - auto arg = this->m_parent->run(); + auto arg = this->m_prior_task->run(); for (auto func : m_funcs) futures.push_back(std::async(std::launch::async, &any_func_task::call, this, std::move(func), arg)); } - void call(Func func, ParentResult arg) + void call(Func func, PriorResult arg) { try { @@ -1580,24 +1580,24 @@ class any_func_task final } private: - Container m_funcs; + Container m_funcs; }; -template class Container, typename Func, typename Allocator> +template class Container, typename Func, typename Alloc> class any_func_task_void final - : public any_task_base, Result, ParentResult> + : public any_task_base, Result, PriorResult> { public: - any_func_task_void(task_ptr parent, Container funcs) - : any_task_base{std::move(parent)} + any_func_task_void(task_ptr prior_task, Container funcs) + : any_task_base{std::move(prior_task)} , m_funcs{std::move(funcs)} {} void async_run(std::vector>& futures) { - this->m_parent->run(); + this->m_prior_task->run(); for (auto func : m_funcs) futures.push_back(std::async(std::launch::async, &any_func_task_void::call, this, std::move(func))); } @@ -1620,23 +1620,23 @@ class any_func_task_void final } private: - Container m_funcs; + Container m_funcs; }; -template class Container, typename Func, typename Allocator> -class any_func_task_void final - : public any_task_base, void, ParentResult> +template class Container, typename Func, typename Alloc> +class any_func_task_void final + : public any_task_base, void, PriorResult> { public: - any_func_task_void(task_ptr parent, Container funcs) - : any_task_base{std::move(parent)} + any_func_task_void(task_ptr prior_task, Container funcs) + : any_task_base{std::move(prior_task)} , m_funcs{std::move(funcs)} {} void async_run(std::vector>& futures) { - this->m_parent->run(); + this->m_prior_task->run(); for (auto func : m_funcs) futures.push_back(std::async(std::launch::async, &any_func_task_void::call, this, std::move(func))); } @@ -1660,16 +1660,16 @@ class any_func_task_void final } private: - Container m_funcs; + Container m_funcs; }; -template -class race_task_base : public iterable_base, public next_task +template +class race_task_base : public iterable_base, public next_task { public: - race_task_base(task_ptr parent) - : next_task{std::move(parent)} + race_task_base(task_ptr prior_task) + : next_task{std::move(prior_task)} {} Result run() final @@ -1684,26 +1684,26 @@ class race_task_base : public iterable_base, public next_task class Container, - typename Method, typename Allocator, typename Class> +template class Container, + typename Method, typename Alloc, typename Class> class race_class_task final - : public race_task_base, Result, ParentResult> + : public race_task_base, Result, PriorResult> { public: - race_class_task(task_ptr parent, Container methods, Class* obj) - : race_task_base{std::move(parent)} + race_class_task(task_ptr prior_task, Container methods, Class* obj) + : race_task_base{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} void async_run(std::vector>& futures) { - auto arg = this->m_parent->run(); + auto arg = this->m_prior_task->run(); for (auto method : this->m_methods) futures.push_back(std::async(std::launch::async, &race_class_task::call, this, std::move(method), arg)); } - void call(Method method, ParentResult arg) + void call(Method method, PriorResult arg) { try { @@ -1721,31 +1721,31 @@ class race_class_task final } private: - Container m_methods; + Container m_methods; Class* const m_obj; }; -template class Container, - typename Method, typename Allocator, typename Class> -class race_class_task final - : public race_task_base, void, ParentResult> +template class Container, + typename Method, typename Alloc, typename Class> +class race_class_task final + : public race_task_base, void, PriorResult> { public: - race_class_task(task_ptr parent, Container methods, Class* obj) - : race_task_base{std::move(parent)} + race_class_task(task_ptr prior_task, Container methods, Class* obj) + : race_task_base{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} void async_run(std::vector>& futures) { - auto arg = this->m_parent->run(); + auto arg = this->m_prior_task->run(); for (auto method : this->m_methods) futures.push_back(std::async(std::launch::async, &race_class_task::call, this, std::move(method), arg)); } - void call(Method method, ParentResult arg) + void call(Method method, PriorResult arg) { try { @@ -1764,26 +1764,26 @@ class race_class_task f } private: - Container m_methods; + Container m_methods; Class* const m_obj; }; -template class Container, - typename Method, typename Allocator, typename Class> +template class Container, + typename Method, typename Alloc, typename Class> class race_class_task_void final - : public race_task_base, Result, ParentResult> + : public race_task_base, Result, PriorResult> { public: - race_class_task_void(task_ptr parent, Container methods, Class* obj) - : race_task_base{std::move(parent)} + race_class_task_void(task_ptr prior_task, Container methods, Class* obj) + : race_task_base{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} void async_run(std::vector>& futures) { - this->m_parent->run(); + this->m_prior_task->run(); for (auto method : this->m_methods) futures.push_back(std::async(std::launch::async, &race_class_task_void::call, this, std::move(method))); } @@ -1806,26 +1806,26 @@ class race_class_task_void final } private: - Container m_methods; + Container m_methods; Class* const m_obj; }; -template class Container, - typename Method, typename Allocator, typename Class> -class race_class_task_void final - : public race_task_base, void, ParentResult> +template class Container, + typename Method, typename Alloc, typename Class> +class race_class_task_void final + : public race_task_base, void, PriorResult> { public: - race_class_task_void(task_ptr parent, Container methods, Class* obj) - : race_task_base{std::move(parent)} + race_class_task_void(task_ptr prior_task, Container methods, Class* obj) + : race_task_base{std::move(prior_task)} , m_methods{std::move(methods)} , m_obj{obj} {} void async_run(std::vector>& futures) { - this->m_parent->run(); + this->m_prior_task->run(); for (auto method : this->m_methods) futures.push_back(std::async(std::launch::async, &race_class_task_void::call, this, std::move(method))); } @@ -1849,30 +1849,30 @@ class race_class_task_void m_methods; + Container m_methods; Class* const m_obj; }; -template class Container, typename Func, typename Allocator> +template class Container, typename Func, typename Alloc> class race_func_task final - : public race_task_base, Result, ParentResult> + : public race_task_base, Result, PriorResult> { public: - race_func_task(task_ptr parent, Container funcs) - : race_task_base{std::move(parent)} + race_func_task(task_ptr prior_task, Container funcs) + : race_task_base{std::move(prior_task)} , m_funcs{std::move(funcs)} {} void async_run(std::vector>& futures) { - auto arg = this->m_parent->run(); + auto arg = this->m_prior_task->run(); for (auto func : this->m_funcs) futures.push_back(std::async(std::launch::async, &race_func_task::call, this, std::move(func), arg)); } - void call(Func func, ParentResult arg) + void call(Func func, PriorResult arg) { try { @@ -1890,28 +1890,28 @@ class race_func_task final } private: - Container m_funcs; + Container m_funcs; }; -template class Container, typename Func, typename Allocator> -class race_func_task final - : public race_task_base, void, ParentResult> +template class Container, typename Func, typename Alloc> +class race_func_task final + : public race_task_base, void, PriorResult> { public: - race_func_task(task_ptr parent, Container funcs) - : race_task_base{std::move(parent)} + race_func_task(task_ptr prior_task, Container funcs) + : race_task_base{std::move(prior_task)} , m_funcs{std::move(funcs)} {} void async_run(std::vector>& futures) { - auto arg = this->m_parent->run(); + auto arg = this->m_prior_task->run(); for (auto func : this->m_funcs) futures.push_back(std::async(std::launch::async, &race_func_task::call, this, std::move(func), arg)); } - void call(Func func, ParentResult arg) + void call(Func func, PriorResult arg) { try { @@ -1930,24 +1930,24 @@ class race_func_task final } private: - Container m_funcs; + Container m_funcs; }; -template class Container, typename Func, typename Allocator> +template class Container, typename Func, typename Alloc> class race_func_task_void final - : public race_task_base, Result, ParentResult> + : public race_task_base, Result, PriorResult> { public: - race_func_task_void(task_ptr parent, Container funcs) - : race_task_base{std::move(parent)} + race_func_task_void(task_ptr prior_task, Container funcs) + : race_task_base{std::move(prior_task)} , m_funcs{std::move(funcs)} {} void async_run(std::vector>& futures) { - this->m_parent->run(); + this->m_prior_task->run(); for (auto func : this->m_funcs) futures.push_back(std::async(std::launch::async, &race_func_task_void::call, this, std::move(func))); } @@ -1970,23 +1970,23 @@ class race_func_task_void final } private: - Container m_funcs; + Container m_funcs; }; -template class Container, typename Func, typename Allocator> -class race_func_task_void final - : public race_task_base, void, ParentResult> +template class Container, typename Func, typename Alloc> +class race_func_task_void final + : public race_task_base, void, PriorResult> { public: - race_func_task_void(task_ptr parent, Container funcs) - : race_task_base{std::move(parent)} + race_func_task_void(task_ptr prior_task, Container funcs) + : race_task_base{std::move(prior_task)} , m_funcs{std::move(funcs)} {} void async_run(std::vector>& futures) { - this->m_parent->run(); + this->m_prior_task->run(); for (auto func : this->m_funcs) futures.push_back(std::async(std::launch::async, &race_func_task_void::call, this, std::move(func))); } @@ -2010,17 +2010,17 @@ class race_func_task_void final } private: - Container m_funcs; + Container m_funcs; }; template class Container, - typename Method, typename Allocator, typename Class, typename... Args> + typename Method, typename Alloc, typename Class, typename... Args> class make_all_class_task final : public task { public: template - make_all_class_task(Container methods, Class* obj, Args_&&... args) + make_all_class_task(Container methods, Class* obj, Args_&&... args) : m_methods{std::move(methods)} , m_obj{obj} , m_args{std::forward(args)...} @@ -2046,19 +2046,19 @@ class make_all_class_task final : public task return class_method_call_helper::call(std::move(method), m_obj, m_args); } - Container m_methods; + Container m_methods; Class* const m_obj; std::tuple m_args; }; template class Container, typename Method, - typename Allocator, typename Class, typename... Args> -class make_all_class_task final : public task + typename Alloc, typename Class, typename... Args> +class make_all_class_task final : public task { public: template - make_all_class_task(Container methods, Class* obj, Args_&&... args) + make_all_class_task(Container methods, Class* obj, Args_&&... args) : m_methods{std::move(methods)} , m_obj{obj} , m_args{std::forward(args)...} @@ -2079,19 +2079,19 @@ class make_all_class_task fi class_method_call_helper::call(std::move(method), m_obj, m_args); } - Container m_methods; + Container m_methods; Class* const m_obj; std::tuple m_args; }; template class Container, - typename Func, typename Allocator, typename... Args> + typename Func, typename Alloc, typename... Args> class make_all_func_task final : public task { public: template - explicit make_all_func_task(Container funcs, Args_&&... args) + explicit make_all_func_task(Container funcs, Args_&&... args) : m_funcs{std::move(funcs)} , m_args{std::forward(args)...} {} @@ -2116,17 +2116,17 @@ class make_all_func_task final : public task return apply(std::move(func), m_args); } - Container m_funcs; + Container m_funcs; std::tuple m_args; }; -template class Container, typename Func, typename Allocator, typename... Args> -class make_all_func_task final : public task +template class Container, typename Func, typename Alloc, typename... Args> +class make_all_func_task final : public task { public: template - explicit make_all_func_task(Container funcs, Args_&&... args) + explicit make_all_func_task(Container funcs, Args_&&... args) : m_funcs{std::move(funcs)} , m_args{std::forward(args)...} {} @@ -2146,18 +2146,18 @@ class make_all_func_task final : publ apply(std::move(func), m_args); } - Container m_funcs; + Container m_funcs; std::tuple m_args; }; template class Container, - typename Method, typename Allocator, typename Class, typename... Args> + typename Method, typename Alloc, typename Class, typename... Args> class make_all_settled_class_task final : public task { public: template - explicit make_all_settled_class_task(Container methods, Class* obj, Args_&&... args) + explicit make_all_settled_class_task(Container methods, Class* obj, Args_&&... args) : m_methods{std::move(methods)} , m_args{std::forward(args)...} , m_obj{obj} @@ -2193,19 +2193,19 @@ class make_all_settled_class_task final : public task return class_method_call_helper::call(std::move(method), m_obj, m_args); } - Container m_methods; + Container m_methods; Class* const m_obj; std::tuple m_args; }; template class Container, - typename Method, typename Allocator, typename Class, typename... Args> -class make_all_settled_class_task final : public task + typename Method, typename Alloc, typename Class, typename... Args> +class make_all_settled_class_task final : public task { public: template - explicit make_all_settled_class_task(Container methods, Class* obj, Args_&&... args) + explicit make_all_settled_class_task(Container methods, Class* obj, Args_&&... args) : m_methods{std::move(methods)} , m_args{std::forward(args)...} , m_obj{obj} @@ -2242,19 +2242,19 @@ class make_all_settled_class_task::call(std::move(method), m_obj, m_args); } - Container m_methods; + Container m_methods; Class* const m_obj; std::tuple m_args; }; template class Container, - typename Func, typename Allocator, typename... Args> + typename Func, typename Alloc, typename... Args> class make_all_settled_func_task final : public task { public: template - explicit make_all_settled_func_task(Container funcs, Args_&&... args) + explicit make_all_settled_func_task(Container funcs, Args_&&... args) : m_funcs{std::move(funcs)} , m_args{std::forward(args)...} {} @@ -2289,18 +2289,18 @@ class make_all_settled_func_task final : public task return apply(std::move(func), m_args); } - Container m_funcs; + Container m_funcs; std::tuple m_args; }; template class Container, - typename Func, typename Allocator, typename... Args> -class make_all_settled_func_task final : public task + typename Func, typename Alloc, typename... Args> +class make_all_settled_func_task final : public task { public: template - explicit make_all_settled_func_task(Container funcs, Args_&&... args) + explicit make_all_settled_func_task(Container funcs, Args_&&... args) : m_funcs{std::move(funcs)} , m_args{std::forward(args)...} {} @@ -2336,7 +2336,7 @@ class make_all_settled_func_task m_funcs; + Container m_funcs; std::tuple m_args; }; @@ -2374,13 +2374,13 @@ class make_any_task_base : public iterable_base, public task template class Container, - typename Method, typename Allocator, typename Class, typename... Args> + typename Method, typename Alloc, typename Class, typename... Args> class make_any_class_task final - : public make_any_task_base, Result> + : public make_any_task_base, Result> { public: template - explicit make_any_class_task(Container methods, Class* obj, Args_&&... args) + explicit make_any_class_task(Container methods, Class* obj, Args_&&... args) : m_methods{std::move(methods)} , m_obj{obj} , m_args{std::forward(args)...} @@ -2411,20 +2411,20 @@ class make_any_class_task final } private: - Container m_methods; + Container m_methods; Class* const m_obj; std::tuple m_args; }; template class Container, typename Method, - typename Allocator, typename Class, typename... Args> -class make_any_class_task final - : public make_any_task_base, void> + typename Alloc, typename Class, typename... Args> +class make_any_class_task final + : public make_any_task_base, void> { public: template - explicit make_any_class_task(Container methods, Class* obj, Args_&&... args) + explicit make_any_class_task(Container methods, Class* obj, Args_&&... args) : m_methods{std::move(methods)} , m_obj{obj} , m_args{std::forward(args)...} @@ -2455,20 +2455,20 @@ class make_any_class_task fi } private: - Container m_methods; + Container m_methods; Class* const m_obj; std::tuple m_args; }; template class Container, - typename Func, typename Allocator, typename... Args> + typename Func, typename Alloc, typename... Args> class make_any_func_task final - : public make_any_task_base, Result> + : public make_any_task_base, Result> { public: template - explicit make_any_func_task(Container funcs, Args_&&... args) + explicit make_any_func_task(Container funcs, Args_&&... args) : m_funcs{std::move(funcs)} , m_args{std::forward(args)...} {} @@ -2497,18 +2497,18 @@ class make_any_func_task final } private: - Container m_funcs; + Container m_funcs; std::tuple m_args; }; -template class Container, typename Func, typename Allocator, typename... Args> -class make_any_func_task final - : public make_any_task_base, void> +template class Container, typename Func, typename Alloc, typename... Args> +class make_any_func_task final + : public make_any_task_base, void> { public: template - explicit make_any_func_task(Container funcs, Args_&&... args) + explicit make_any_func_task(Container funcs, Args_&&... args) : m_funcs{std::move(funcs)} , m_args{std::forward(args)...} {} @@ -2538,7 +2538,7 @@ class make_any_func_task final } private: - Container m_funcs; + Container m_funcs; std::tuple m_args; }; @@ -2560,13 +2560,13 @@ class make_race_task_base : public iterable_base, public task template class Container, typename Method, - typename Allocator, typename Class, typename... Args> + typename Alloc, typename Class, typename... Args> class make_race_class_task final - : public make_race_task_base, Result> + : public make_race_task_base, Result> { public: template - explicit make_race_class_task(Container methods, Class* obj, Args_&&... args) + explicit make_race_class_task(Container methods, Class* obj, Args_&&... args) : m_methods{std::move(methods)} , m_obj{obj} , m_args{std::forward(args)...} @@ -2597,20 +2597,20 @@ class make_race_class_task final } private: - Container m_methods; + Container m_methods; Class* const m_obj; std::tuple m_args; }; template class Container, typename Method, - typename Allocator, typename Class, typename... Args> -class make_race_class_task final - : public make_race_task_base, void> + typename Alloc, typename Class, typename... Args> +class make_race_class_task final + : public make_race_task_base, void> { public: template - explicit make_race_class_task(Container methods, Class* obj, Args_&&... args) + explicit make_race_class_task(Container methods, Class* obj, Args_&&... args) : m_methods{std::move(methods)} , m_obj{obj} , m_args{std::forward(args)...} @@ -2641,20 +2641,20 @@ class make_race_class_task f } private: - Container m_methods; + Container m_methods; Class* const m_obj; std::tuple m_args; }; template class Container, - typename Func, typename Allocator, typename... Args> + typename Func, typename Alloc, typename... Args> class make_race_func_task final - : public make_race_task_base, Result> + : public make_race_task_base, Result> { public: template - explicit make_race_func_task(Container funcs, Args_&&... args) + explicit make_race_func_task(Container funcs, Args_&&... args) : m_funcs{std::move(funcs)} , m_args{std::forward(args)...} {} @@ -2683,18 +2683,18 @@ class make_race_func_task final } private: - Container m_funcs; + Container m_funcs; std::tuple m_args; }; -template class Container, typename Func, typename Allocator, typename... Args> -class make_race_func_task final - : public make_race_task_base, void> +template class Container, typename Func, typename Alloc, typename... Args> +class make_race_func_task final + : public make_race_task_base, void> { public: template - explicit make_race_func_task(Container funcs, Args_&&... args) + explicit make_race_func_task(Container funcs, Args_&&... args) : m_funcs{std::move(funcs)} , m_args{std::forward(args)...} {} @@ -2724,7 +2724,7 @@ class make_race_func_task final } private: - Container m_funcs; + Container m_funcs; std::tuple m_args; }; @@ -2985,14 +2985,14 @@ class promise * @param obj - Object containing the required methods. * @return Promise object. */ - template class Container, typename Method, typename Allocator, typename Class, + template class Container, typename Method, typename Alloc, typename Class, typename Arg = T, typename FuncResult = typename std::result_of::type, typename Result = Container>, typename = typename std::enable_if::value>::type, typename = typename std::enable_if::value>::type> - promise all(Container methods, Class* obj) const + promise all(Container methods, Class* obj) const { - using task = internal::all_class_task; + using task = internal::all_class_task; return promise{std::make_shared(m_task, std::move(methods), obj)}; } @@ -3004,13 +3004,13 @@ class promise * @param obj - Object containing the required methods. * @return Promise object. */ - template class Container, typename Method, typename Allocator, typename Class, + template class Container, typename Method, typename Alloc, typename Class, typename FuncResult = typename std::result_of::type, typename Result = Container>, typename = typename std::enable_if::value>::type> - promise all(Container methods, Class* obj) const + promise all(Container methods, Class* obj) const { - using task = internal::all_class_task_void; + using task = internal::all_class_task_void; return promise{std::make_shared(m_task, std::move(methods), obj)}; } @@ -3022,13 +3022,13 @@ class promise * @param obj - Object containing the required methods. * @return Promise object. */ - template class Container, typename Method, typename Allocator, typename Class, + template class Container, typename Method, typename Alloc, typename Class, typename Arg = T, typename FuncResult = typename std::result_of::type, typename = typename std::enable_if::value>::type, typename = typename std::enable_if::value>::type> - promise all(Container methods, Class* obj) const + promise all(Container methods, Class* obj) const { - using task = internal::all_class_task; + using task = internal::all_class_task; return promise{std::make_shared(m_task, std::move(methods), obj)}; } @@ -3040,12 +3040,12 @@ class promise * @param obj - Object containing the required methods. * @return Promise object. */ - template class Container, typename Method, typename Allocator, typename Class, + template class Container, typename Method, typename Alloc, typename Class, typename FuncResult = typename std::result_of::type, typename = typename std::enable_if::value>::type> - promise all(Container methods, Class* obj) const + promise all(Container methods, Class* obj) const { - using task = internal::all_class_task_void; + using task = internal::all_class_task_void; return promise{std::make_shared(m_task, std::move(methods), obj)}; } @@ -3056,14 +3056,14 @@ class promise * @param funcs - Functions that receives the result of the previous function. * @return Promise object. */ - template class Container, typename Func, typename Allocator, + template class Container, typename Func, typename Alloc, typename Arg = T, typename FuncResult = typename std::result_of::type, typename Result = Container>, typename = typename std::enable_if::value>::type, typename = typename std::enable_if::value>::type> - promise all(Container funcs) const + promise all(Container funcs) const { - using task = internal::all_func_task; + using task = internal::all_func_task; return promise{std::make_shared(m_task, std::move(funcs))}; } @@ -3074,13 +3074,13 @@ class promise * @param funcs - Functions that not receives any result of the previous function. * @return Promise object. */ - template class Container, typename Func, typename Allocator, + template class Container, typename Func, typename Alloc, typename FuncResult = typename std::result_of::type, typename Result = Container>, typename = typename std::enable_if::value>::type> - promise all(Container funcs) const + promise all(Container funcs) const { - using task = internal::all_func_task_void; + using task = internal::all_func_task_void; return promise{std::make_shared(m_task, std::move(funcs))}; } @@ -3091,13 +3091,13 @@ class promise * @param funcs - Functions that receives the result of the previous function. * @return Promise object. */ - template class Container, typename Func, typename Allocator, + template class Container, typename Func, typename Alloc, typename Arg = T, typename FuncResult = typename std::result_of::type, typename = typename std::enable_if::value>::type, typename = typename std::enable_if::value>::type> - promise all(Container funcs) const + promise all(Container funcs) const { - using task = internal::all_func_task; + using task = internal::all_func_task; return promise{std::make_shared(m_task, std::move(funcs))}; } @@ -3108,12 +3108,12 @@ class promise * @param funcs - Functions that not receives any result of the previous function. * @return Promise object. */ - template class Container, typename Func, typename Allocator, + template class Container, typename Func, typename Alloc, typename FuncResult = typename std::result_of::type, typename = typename std::enable_if::value>::type> - promise all(Container funcs) const + promise all(Container funcs) const { - using task = internal::all_func_task_void; + using task = internal::all_func_task_void; return promise{std::make_shared(m_task, std::move(funcs))}; } @@ -3125,14 +3125,14 @@ class promise * @param obj - Object containing the required methods. * @return Promise object. */ - template class Container, typename Method, typename Allocator, typename Class, + template class Container, typename Method, typename Alloc, typename Class, typename Arg = T, typename FuncResult = typename std::result_of::type, typename Result = Container, std::allocator>>, typename = typename std::enable_if::value>::type, typename = typename std::enable_if::value>::type> - promise all_settled(Container methods, Class* obj) const + promise all_settled(Container methods, Class* obj) const { - using task = internal::all_settled_class_task; + using task = internal::all_settled_class_task; return promise{std::make_shared(m_task, std::move(methods), obj)}; } @@ -3144,14 +3144,14 @@ class promise * @param obj - Object containing the required methods. * @return Promise object. */ - template class Container, typename Method, typename Allocator, typename Class, + template class Container, typename Method, typename Alloc, typename Class, typename FuncResult = typename std::result_of::type, typename Result = Container, std::allocator>>, typename = typename std::enable_if::value>::type, typename = typename std::true_type::type> - promise all_settled(Container methods, Class* obj) const + promise all_settled(Container methods, Class* obj) const { - using task = internal::all_settled_class_task_void; + using task = internal::all_settled_class_task_void; return promise{std::make_shared(m_task, std::move(methods), obj)}; } @@ -3163,15 +3163,15 @@ class promise * @param obj - Object containing the required methods. * @return Promise object. */ - template class Container, typename Method, typename Allocator, typename Class, + template class Container, typename Method, typename Alloc, typename Class, typename Arg = T, typename FuncResult = typename std::result_of::type, typename Result = Container, std::allocator>>, typename = typename std::enable_if::value>::type, typename = typename std::enable_if::value>::type, typename = typename std::true_type::type> - promise all_settled(Container methods, Class* obj) const + promise all_settled(Container methods, Class* obj) const { - using task = internal::all_settled_class_task; + using task = internal::all_settled_class_task; return promise{std::make_shared(m_task, std::move(methods), obj)}; } @@ -3183,13 +3183,13 @@ class promise * @param obj - Object containing the required methods. * @return Promise object. */ - template class Container, typename Method, typename Allocator, typename Class, + template class Container, typename Method, typename Alloc, typename Class, typename FuncResult = typename std::result_of::type, typename Result = Container, std::allocator>>, typename = typename std::enable_if::value>::type> - promise all_settled(Container methods, Class* obj) const + promise all_settled(Container methods, Class* obj) const { - using task = internal::all_settled_class_task_void; + using task = internal::all_settled_class_task_void; return promise{std::make_shared(m_task, std::move(methods), obj)}; } @@ -3200,14 +3200,14 @@ class promise * @param funcs - Functions that receives the result of the previous function. * @return Promise object. */ - template class Container, typename Func, typename Allocator, + template class Container, typename Func, typename Alloc, typename Arg = T, typename FuncResult = typename std::result_of::type, typename Result = Container, std::allocator>>, typename = typename std::enable_if::value>::type, typename = typename std::enable_if::value>::type> - promise all_settled(Container funcs) const + promise all_settled(Container funcs) const { - using task = internal::all_settled_func_task; + using task = internal::all_settled_func_task; return promise{std::make_shared(m_task, std::move(funcs))}; } @@ -3218,14 +3218,14 @@ class promise * @param funcs - Functions that receives the result of the previous function. * @return Promise object. */ - template class Container, typename Func, typename Allocator, + template class Container, typename Func, typename Alloc, typename FuncResult = typename std::result_of::type, typename Result = Container, std::allocator>>, typename = typename std::enable_if::value>::type, typename = typename std::true_type::type> - promise all_settled(Container funcs) const + promise all_settled(Container funcs) const { - using task = internal::all_settled_func_task_void; + using task = internal::all_settled_func_task_void; return promise{std::make_shared(m_task, std::move(funcs))}; } @@ -3236,15 +3236,15 @@ class promise * @param funcs - Functions that receives the result of the previous function. * @return Promise object. */ - template class Container, typename Func, typename Allocator, + template class Container, typename Func, typename Alloc, typename Arg = T, typename FuncResult = typename std::result_of::type, typename Result = Container, std::allocator>>, typename = typename std::enable_if::value>::type, typename = typename std::enable_if::value>::type, typename = typename std::true_type::type> - promise all_settled(Container funcs) const + promise all_settled(Container funcs) const { - using task = internal::all_settled_func_task; + using task = internal::all_settled_func_task; return promise{std::make_shared(m_task, std::move(funcs))}; } @@ -3255,13 +3255,13 @@ class promise * @param funcs - Functions that receives the result of the previous function. * @return Promise object. */ - template class Container, typename Func, typename Allocator, + template class Container, typename Func, typename Alloc, typename FuncResult = typename std::result_of::type, typename Result = Container, std::allocator>>, typename = typename std::enable_if::value>::type> - promise all_settled(Container funcs) const + promise all_settled(Container funcs) const { - using task = internal::all_settled_func_task_void; + using task = internal::all_settled_func_task_void; return promise{std::make_shared(m_task, std::move(funcs))}; } @@ -3273,12 +3273,12 @@ class promise * @param obj - Object containing the required methods. * @return Promise object. */ - template class Container, typename Method, typename Allocator, typename Class, + template class Container, typename Method, typename Alloc, typename Class, typename Arg = T, typename Result = typename std::result_of::type, typename = typename std::enable_if::value>::type> - promise any(Container methods, Class* obj) const + promise any(Container methods, Class* obj) const { - using task = internal::any_class_task; + using task = internal::any_class_task; return promise{std::make_shared(m_task, std::move(methods), obj)}; } @@ -3290,11 +3290,11 @@ class promise * @param obj - Object containing the required methods. * @return Promise object. */ - template class Container, typename Method, typename Allocator, typename Class, + template class Container, typename Method, typename Alloc, typename Class, typename Result = typename std::result_of::type> - promise any(Container methods, Class* obj) const + promise any(Container methods, Class* obj) const { - using task = internal::any_class_task_void; + using task = internal::any_class_task_void; return promise{std::make_shared(m_task, std::move(methods), obj)}; } @@ -3305,12 +3305,12 @@ class promise * @param funcs - Functions that receives the result of the previous function. * @return Promise object. */ - template class Container, typename Func, typename Allocator, + template class Container, typename Func, typename Alloc, typename Arg = T, typename Result = typename std::result_of::type, typename = typename std::enable_if::value>::type> - promise any(Container funcs) const + promise any(Container funcs) const { - using task = internal::any_func_task; + using task = internal::any_func_task; return promise{std::make_shared(m_task, std::move(funcs))}; } @@ -3321,11 +3321,11 @@ class promise * @param funcs - Functions that not receives any result of the previous function. * @return Promise object. */ - template class Container, typename Func, typename Allocator, + template class Container, typename Func, typename Alloc, typename Result = typename std::result_of::type> - promise any(Container funcs) const + promise any(Container funcs) const { - using task = internal::any_func_task_void; + using task = internal::any_func_task_void; return promise{std::make_shared(m_task, std::move(funcs))}; } @@ -3337,12 +3337,12 @@ class promise * @param obj - Object containing the required methods. * @return Promise object. */ - template class Container, typename Method, typename Allocator, typename Class, + template class Container, typename Method, typename Alloc, typename Class, typename Arg = T, typename Result = typename std::result_of::type, typename = typename std::enable_if::value>::type> - promise race(Container methods, Class* obj) const + promise race(Container methods, Class* obj) const { - using task = internal::race_class_task; + using task = internal::race_class_task; return promise{std::make_shared(m_task, std::move(methods), obj)}; } @@ -3354,11 +3354,11 @@ class promise * @param obj - Object containing the required methods. * @return Promise object. */ - template class Container, typename Method, typename Allocator, typename Class, + template class Container, typename Method, typename Alloc, typename Class, typename Result = typename std::result_of::type> - promise race(Container methods, Class* obj) const + promise race(Container methods, Class* obj) const { - using task = internal::race_class_task_void; + using task = internal::race_class_task_void; return promise{std::make_shared(m_task, std::move(methods), obj)}; } @@ -3369,12 +3369,12 @@ class promise * @param funcs - Functions that receives the result of the previous function. * @return Promise object. */ - template class Container, typename Func, typename Allocator, + template class Container, typename Func, typename Alloc, typename Arg = T, typename Result = typename std::result_of::type, typename = typename std::enable_if::value>::type> - promise race(Container funcs) const + promise race(Container funcs) const { - using task = internal::race_func_task; + using task = internal::race_func_task; return promise{std::make_shared(m_task, std::move(funcs))}; } @@ -3385,11 +3385,11 @@ class promise * @param funcs - Functions that not receives any result of the previous function. * @return Promise object. */ - template class Container, typename Func, typename Allocator, + template class Container, typename Func, typename Alloc, typename Result = typename std::result_of::type> - promise race(Container funcs) const + promise race(Container funcs) const { - using task = internal::race_func_task_void; + using task = internal::race_func_task_void; return promise{std::make_shared(m_task, std::move(funcs))}; } @@ -3453,14 +3453,14 @@ static promise make_promise(Func&& func, Args&&... args) * @return Promise object. */ template class Container, typename Method, - typename Allocator, typename Class, typename... Args, + typename Alloc, typename Class, typename... Args, typename FuncResult = typename std::result_of::type, typename Result = Container>, typename = typename std::enable_if::value>::type, typename = typename std::enable_if::value>::type> -static promise make_promise_all(Container methods, Class* obj, Args&&... args) +static promise make_promise_all(Container methods, Class* obj, Args&&... args) { - using task = internal::make_all_class_task; + using task = internal::make_all_class_task; return promise{std::make_shared(std::move(methods), obj, std::forward(args)...)}; } @@ -3474,13 +3474,13 @@ static promise make_promise_all(Container methods, Cl * @return Promise object. */ template class Container, typename Method, - typename Allocator, typename Class, typename... Args, + typename Alloc, typename Class, typename... Args, typename FuncResult = typename std::result_of::type, typename = typename std::enable_if::value>::type, typename = typename std::enable_if::value>::type> -static promise make_promise_all(Container methods, Class* obj, Args&&... args) +static promise make_promise_all(Container methods, Class* obj, Args&&... args) { - using task = internal::make_all_class_task; + using task = internal::make_all_class_task; return promise{std::make_shared(std::move(methods), obj, std::forward(args)...)}; } @@ -3492,13 +3492,13 @@ static promise make_promise_all(Container methods, Clas * @param args - Optional arguments. * @return Promise object. */ -template class Container, typename Func, typename Allocator, typename... Args, +template class Container, typename Func, typename Alloc, typename... Args, typename FuncResult = typename std::result_of::type, typename Result = Container>, typename = typename std::enable_if::value>::type> -static promise make_promise_all(Container funcs, Args&&... args) +static promise make_promise_all(Container funcs, Args&&... args) { - using task = internal::make_all_func_task; + using task = internal::make_all_func_task; return promise{std::make_shared(std::move(funcs), std::forward(args)...)}; } @@ -3510,12 +3510,12 @@ static promise make_promise_all(Container funcs, Args&& * @param args - Optional arguments. * @return Promise object. */ -template class Container, typename Func, typename Allocator, typename... Args, +template class Container, typename Func, typename Alloc, typename... Args, typename FuncResult = typename std::result_of::type, typename = typename std::enable_if::value>::type> -static promise make_promise_all(Container funcs, Args&&... args) +static promise make_promise_all(Container funcs, Args&&... args) { - using task = internal::make_all_func_task; + using task = internal::make_all_func_task; return promise{std::make_shared(std::move(funcs), std::forward(args)...)}; } @@ -3527,13 +3527,13 @@ static promise make_promise_all(Container funcs, Args&&.. * @param args - Optional arguments. * @return Promise object. */ -template class Container, typename Method, typename Allocator, typename Class, +template class Container, typename Method, typename Alloc, typename Class, typename... Args, typename FuncResult = typename std::result_of::type, typename Result = Container, std::allocator>>, typename = typename std::enable_if::value>::type> -static promise make_promise_all_settled(Container methods, Class* obj, Args&&... args) +static promise make_promise_all_settled(Container methods, Class* obj, Args&&... args) { - using task = internal::make_all_settled_class_task; + using task = internal::make_all_settled_class_task; return promise{std::make_shared(std::move(methods), obj, std::forward(args)...)}; } @@ -3545,12 +3545,12 @@ static promise make_promise_all_settled(Container met * @param args - Optional arguments. * @return Promise object. */ -template class Container, typename Func, typename Allocator, typename... Args, +template class Container, typename Func, typename Alloc, typename... Args, typename FuncResult = typename std::result_of::type, typename Result = Container, std::allocator>>> -static promise make_promise_all_settled(Container funcs, Args&&... args) +static promise make_promise_all_settled(Container funcs, Args&&... args) { - using task = internal::make_all_settled_func_task; + using task = internal::make_all_settled_func_task; return promise{std::make_shared(std::move(funcs), std::forward(args)...)}; } @@ -3564,12 +3564,12 @@ static promise make_promise_all_settled(Container funcs * @return Promise object. */ template class Container, typename Method, - typename Allocator, typename Class, typename... Args, + typename Alloc, typename Class, typename... Args, typename Result = typename std::result_of::type, typename = typename std::enable_if::value>::type> -static promise make_promise_any(Container methods, Class* obj, Args&&... args) +static promise make_promise_any(Container methods, Class* obj, Args&&... args) { - using task = internal::make_any_class_task; + using task = internal::make_any_class_task; return promise{std::make_shared(std::move(methods), obj, std::forward(args)...)}; } @@ -3581,11 +3581,11 @@ static promise make_promise_any(Container methods, Cl * @param args - Optional arguments. * @return Promise object. */ -template class Container, typename Func, typename Allocator, typename... Args, +template class Container, typename Func, typename Alloc, typename... Args, typename Result = typename std::result_of::type> -static promise make_promise_any(Container funcs, Args&&... args) +static promise make_promise_any(Container funcs, Args&&... args) { - using task = internal::make_any_func_task; + using task = internal::make_any_func_task; return promise{std::make_shared(std::move(funcs), std::forward(args)...)}; } @@ -3599,12 +3599,12 @@ static promise make_promise_any(Container funcs, Args&& * @return Promise object. */ template class Container, typename Method, - typename Allocator, typename Class, typename... Args, + typename Alloc, typename Class, typename... Args, typename Result = typename std::result_of::type, typename = typename std::enable_if::value>::type> -static promise make_promise_race(Container methods, Class* obj, Args&&... args) +static promise make_promise_race(Container methods, Class* obj, Args&&... args) { - using task = internal::make_race_class_task; + using task = internal::make_race_class_task; return promise{std::make_shared(std::move(methods), obj, std::forward(args)...)}; } @@ -3616,11 +3616,11 @@ static promise make_promise_race(Container methods, C * @param args - Optional arguments. * @return Promise object. */ -template class Container, typename Func, typename Allocator, typename... Args, +template class Container, typename Func, typename Alloc, typename... Args, typename Result = typename std::result_of::type> -static promise make_promise_race(Container funcs, Args&&... args) +static promise make_promise_race(Container funcs, Args&&... args) { - using task = internal::make_race_func_task; + using task = internal::make_race_func_task; return promise{std::make_shared(std::move(funcs), std::forward(args)...)}; }