diff --git a/fluent/Continuable.h b/fluent/Continuable.h index 5f5c4f2..e4dbf40 100644 --- a/fluent/Continuable.h +++ b/fluent/Continuable.h @@ -96,36 +96,6 @@ namespace detail } }; - template<> - struct convert_void_to_continuable - { - typedef _ContinuableImpl> type; - - template - static type invoke(Fn functional, Args... args) - { - // Invoke the void returning functional - functional(std::forward(args)...); - - // Return a fake void continuable - return type([](Callback<>&&) - { - }); - } - }; - - template - struct convert_void_to_continuable<_ContinuableImpl<_State, _CTy>> - { - typedef _ContinuableImpl<_State, _CTy> type; - - template - static type invoke(Fn functional, Args... args) - { - return functional(std::forward(args)...); - } - }; - template class _ContinuableImpl, std::function> { @@ -251,6 +221,36 @@ namespace detail return *this; } }; + + template<> + struct convert_void_to_continuable + { + typedef _ContinuableImpl> type; + + template + static type invoke(Fn functional, Args... args) + { + // Invoke the void returning functional + functional(std::forward(args)...); + + // Return a fake void continuable + return type([](Callback<>&&) + { + }); + } + }; + + template + struct convert_void_to_continuable<_ContinuableImpl<_State, _CTy>> + { + typedef _ContinuableImpl<_State, _CTy> type; + + template + static type invoke(Fn functional, Args... args) + { + return functional(std::forward(args)...); + } + }; } /// A continuable provides useful methods to react on the result of callbacks