more work

This commit is contained in:
Denis Blank 2015-07-02 01:24:16 +02:00 committed by Naios
parent 41fdaaf1dd
commit d4ea5b8be6
3 changed files with 19 additions and 10 deletions

View File

@ -94,6 +94,10 @@ private:
} }
public: public:
/// Developing
Continuable() : _released(true) { }
/// Deleted copy construct /// Deleted copy construct
Continuable(Continuable const&) = delete; Continuable(Continuable const&) = delete;
@ -487,7 +491,7 @@ namespace detail
template<typename... Args> template<typename... Args>
struct multiple_when_all_chainer_t_make_result<fu::identity<Args...>> struct multiple_when_all_chainer_t_make_result<fu::identity<Args...>>
{ {
typedef std::function<Continuable</*Args...*/>()> type; typedef Continuable<Args...> type;
// type create() // type create()
}; };
@ -507,11 +511,7 @@ namespace detail
static auto make_when_all(_CTy&&... args) static auto make_when_all(_CTy&&... args)
-> typename multiple_when_all_chainer_t_make_result<arguments_t>::type -> typename multiple_when_all_chainer_t_make_result<arguments_t>::type
{ {
return make_continuable([]() return multiple_when_all_chainer_t_make_result<arguments_t>::type();
{
});
} }
}; };
} }

View File

@ -221,8 +221,8 @@ namespace fu
struct invoker<sequence<Sequence...>> struct invoker<sequence<Sequence...>>
{ {
template<typename _FTy, typename _TTy> template<typename _FTy, typename _TTy>
static auto invoke(_FTy&& functional, _TTy&& tuple) inline static auto invoke(_FTy&& functional, _TTy&& tuple)
-> ::fu::return_type_of_t<typename std::decay<_FTy>::type> -> return_type_of_t<typename std::decay<_FTy>::type>
{ {
return std::forward<_FTy>(functional)(std::get<Sequence>(std::forward<_TTy>(tuple))...); return std::forward<_FTy>(functional)(std::get<Sequence>(std::forward<_TTy>(tuple))...);
} }

View File

@ -345,10 +345,11 @@ int main(int /*argc*/, char** /*argv*/)
> >
>::result_maker::partial_results_t myres123345; >::result_maker::partial_results_t myres123345;
detail::multiple_when_all_chainer_t< auto firstType = detail::multiple_when_all_chainer_t<
fu::identity<>, fu::identity<>,
fu::identity< fu::identity<
std::function<Continuable<>()>, std::function<Continuable<>()>,
std::function<Continuable<SpellCastResult>()>,
std::function<Continuable<SpellCastResult>()> std::function<Continuable<SpellCastResult>()>
> >
>::make_when_all( >::make_when_all(
@ -358,7 +359,15 @@ int main(int /*argc*/, char** /*argv*/)
}, },
[] []
{ {
return CastSpellPromise(2); return CastSpellPromise(10);
},
[]
{
return CastSpellPromise(20);
})
.then([](SpellCastResult, SpellCastResult)
{
}); });
std::cout << "ok" << std::endl; std::cout << "ok" << std::endl;