From 566e8287f7e468da9bc36e448d66c68b6ea47e9e Mon Sep 17 00:00:00 2001 From: Naios Date: Sun, 14 Jun 2015 21:04:08 +0200 Subject: [PATCH] omg msvc... --- fluent/Continuable.h | 46 +++++++++++++++++++++++--------------------- test.cpp | 5 ----- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/fluent/Continuable.h b/fluent/Continuable.h index de4d19f..1b855df 100644 --- a/fluent/Continuable.h +++ b/fluent/Continuable.h @@ -38,22 +38,6 @@ namespace detail // ContinuableImpl Forward definition template class _ContinuableImpl; - - /// Corrects void return types from functional types which should be Continuable> - template - struct convert_void_to_continuable; - - template<> - struct convert_void_to_continuable - { - typedef _ContinuableImpl> type; - }; - - template - struct convert_void_to_continuable<_ContinuableImpl<_State, _CTy>> - { - typedef _ContinuableImpl<_State, _CTy> type; - }; template class _ContinuableImpl, std::function> @@ -119,18 +103,34 @@ namespace detail return *this; } + /// Corrects void return types from functional types which should be Continuable> + template + struct convert_void_to_continuable; + + template<> + struct convert_void_to_continuable + { + typedef _ContinuableImpl> type; + }; + + template + struct convert_void_to_continuable<_ContinuableImpl<_State, _CTy>> + { + typedef _ContinuableImpl<_State, _CTy> type; + }; + template struct unary_chainer; + // MSVC 12 has issues to detect the parameter pack otherwise. template struct unary_chainer<_NextRTy, fu::identity<_NextATy...>> { template - static auto chain(_CTy&& /*functional*/, _ContinuableImpl&& /*me*/) - -> typename convert_void_to_continuable<_NextRTy>::type + static auto chain(_CTy&& /*functional*//*, _MTy&& me*/) + -> _ContinuableImpl> // typename convert_void_to_continuable::type { - return convert_void_to_continuable<_NextRTy>::type(); - // _ContinuableImpl, Callback<_NextATy...>>(); + return _ContinuableImpl>(); } }; @@ -141,9 +141,11 @@ namespace detail template auto then(_CTy&& functional) - -> decltype(unary_chainer_t<_CTy>::chain(std::declval<_CTy>(), std::declval<_ContinuableImpl&&>)) + -> decltype(unary_chainer_t<_CTy>::chain(std::declval<_CTy>() + // std::declval<_ContinuableImpl, std::function>>()) + )) { - return unary_chainer_t<_CTy>::chain(std::forward<_CTy>(), std::move(*this)); + return unary_chainer_t<_CTy>::chain(std::forward<_CTy>(functional)/*, std::move(*this)*/); } /* diff --git a/test.cpp b/test.cpp index 5755b7b..9c9c0c2 100644 --- a/test.cpp +++ b/test.cpp @@ -113,11 +113,6 @@ int main(int /*argc*/, char** /*argv*/) typedef fu::requires_functional_constructible>::type test_assert1; // typedef fu::requires_functional_constructible>::type test_assert2; - detail::convert_void_to_continuable::type* _test5 = nullptr; - _test5 = nullptr; - - detail::convert_void_to_continuable>>::type* _test6 = nullptr; - _test6 = nullptr; std::cout << "ok" << std::endl; return 0;