From be064f7038d44ae3e0f253d518a9df0625873a2c Mon Sep 17 00:00:00 2001 From: Naios Date: Thu, 11 Jun 2015 02:23:56 +0200 Subject: [PATCH] fix some stupid clang fails --- fluent/Callback.h | 8 ++++---- fluent/Continuable.h | 2 +- test.cpp | 21 ++++++++++++++++++--- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/fluent/Callback.h b/fluent/Callback.h index d395548..756b32f 100644 --- a/fluent/Callback.h +++ b/fluent/Callback.h @@ -39,8 +39,8 @@ namespace detail template struct do_unwrap_callback; - template - struct do_unwrap_callback> + template + struct do_unwrap_callback> { typedef Callback<_ATy...> CallbackType; @@ -52,6 +52,7 @@ namespace detail template using unwrap_callback_t = do_unwrap_callback<::fu::function_type_of_t<_CTy>>; + /* template struct WeakProxyFactory { @@ -69,8 +70,7 @@ namespace detail return CreateProxyFromWeak(WeakCallback(shared_callback)); } }; - - + **/ } // detail template diff --git a/fluent/Continuable.h b/fluent/Continuable.h index f3f98e1..0527b40 100644 --- a/fluent/Continuable.h +++ b/fluent/Continuable.h @@ -47,7 +47,7 @@ namespace detail struct ContinuableFactory; template - struct ContinuableFactory<_FTy, _RTy, ::fu::identity&&>> + struct ContinuableFactory<_FTy, _RTy, ::fu::identity&&>> { static auto CreateFrom(_FTy&& functional) -> Continuable<_ATy...> diff --git a/test.cpp b/test.cpp index d8da845..bdda4b2 100644 --- a/test.cpp +++ b/test.cpp @@ -5,6 +5,7 @@ #include #include +#include enum SpellCastResult { @@ -29,9 +30,23 @@ Continuable CastSpell(int id) int main(int argc, char** argv) { - shared_callback_of_t> sc1; - weak_callback_of_t> sc2; - + auto lam = [=](Callback&& callback) + { + // on success call the callback with SPELL_FAILED_SUCCESS + callback(SPELL_FAILED_SUCCESS); + }; + + // static_assert(std::is_void::value, "blub"); + + fu::function_type_of_t fun1; + fun1 = lam; + fun1(Callback()); + + fu::function_type_of_t> fun2; + + shared_callback_of_t> fun3; + weak_callback_of_t> fun4; + // make_weak_wrapped_callback(sc1); // make_weak_wrapped_callback(sc2);