diff --git a/include/Callback.h b/include/Callback.h index b85fbad..620d7be 100644 --- a/include/Callback.h +++ b/include/Callback.h @@ -19,16 +19,6 @@ #ifndef _CALLBACK_H_ #define _CALLBACK_H_ -enum SpellCastResult -{ - SPELL_FAILED_SUCCESS = 0, - SPELL_FAILED_AFFECTING_COMBAT = 1, - SPELL_FAILED_ALREADY_AT_FULL_HEALTH = 2, - SPELL_FAILED_ALREADY_AT_FULL_MANA = 3, - SPELL_FAILED_ALREADY_AT_FULL_POWER = 4, - SPELL_FAILED_ALREADY_BEING_TAMED = 5 -}; - #include #include #include diff --git a/include/Continuable.h b/include/Continuable.h index 31a832e..e8ac4d4 100644 --- a/include/Continuable.h +++ b/include/Continuable.h @@ -54,6 +54,9 @@ namespace detail template struct unary_chainer_t; + template + struct multiple_when_all_chainer_t; + /// Functional traits forward declaration. template struct functional_traits; @@ -176,39 +179,18 @@ public: }, std::move(*this)); } - /* - template - Continuable& _wrap_all(_CTy&&...) - { - typedef detail::multiple_all_chainer<_CTy...> type; - - return *this; - } - */ - - /// Placeholder template auto all(_CTy&&... functionals) - -> Continuable - /*typename detail::multiple_when_all_chainer_t< + -> typename detail::multiple_when_all_chainer_t< fu::identity<_ATy...>, fu::identity<_CTy...> >::make_result::continuable_t - */ { - return then([]() - { - return Continuable(); - }); - - /* - - return then( + return then( detail::multiple_when_all_chainer_t< fu::identity<_ATy...>, fu::identity<_CTy...> - >::make_when_all(std::forward<_CTy>(functionals)...)) - */ + >::make_when_all(std::forward<_CTy>(functionals)...)); } /// Placeholder @@ -315,10 +297,6 @@ namespace detail typedef fu::argument_type_of_t callback_arguments_t; }; - /// Helper trait for multiple chains like `Continuable::all` - template - struct multiple_when_all_chainer_t; - template struct concat_identities; @@ -518,12 +496,13 @@ namespace detail return [=](_ATy&&... args) { - + // Fake continuable return continuable_t(); }; } }; + /// Helper trait for multiple chains like `Continuable::all` template struct multiple_when_all_chainer_t, fu::identity<_CTy...>> { diff --git a/test.cpp b/test.cpp index ae673ad..e585abb 100644 --- a/test.cpp +++ b/test.cpp @@ -12,7 +12,15 @@ #include - +enum SpellCastResult +{ + SPELL_FAILED_SUCCESS = 0, + SPELL_FAILED_AFFECTING_COMBAT = 1, + SPELL_FAILED_ALREADY_AT_FULL_HEALTH = 2, + SPELL_FAILED_ALREADY_AT_FULL_MANA = 3, + SPELL_FAILED_ALREADY_AT_FULL_POWER = 4, + SPELL_FAILED_ALREADY_BEING_TAMED = 5 +}; template using Optional = boost::optional;