fix some stupid clang fails

This commit is contained in:
Naios 2015-06-11 02:23:56 +02:00
parent b631628796
commit be064f7038
3 changed files with 23 additions and 8 deletions

View File

@ -39,8 +39,8 @@ namespace detail
template<typename Function>
struct do_unwrap_callback;
template<typename _RTy, typename... _ATy>
struct do_unwrap_callback<std::function<_RTy(_ATy...)>>
template<typename... _ATy>
struct do_unwrap_callback<std::function<void(_ATy...)>>
{
typedef Callback<_ATy...> CallbackType;
@ -52,6 +52,7 @@ namespace detail
template<typename _CTy>
using unwrap_callback_t = do_unwrap_callback<::fu::function_type_of_t<_CTy>>;
/*
template<typename... Args>
struct WeakProxyFactory
{
@ -69,8 +70,7 @@ namespace detail
return CreateProxyFromWeak(WeakCallback<Args...>(shared_callback));
}
};
**/
} // detail
template<typename _CTy>

View File

@ -47,7 +47,7 @@ namespace detail
struct ContinuableFactory;
template <typename _FTy, typename _RTy, typename... _ATy>
struct ContinuableFactory<_FTy, _RTy, ::fu::identity<Callback<_ATy...>&&>>
struct ContinuableFactory<_FTy, _RTy, ::fu::identity<std::function<void(_ATy...)>&&>>
{
static auto CreateFrom(_FTy&& functional)
-> Continuable<_ATy...>

View File

@ -5,6 +5,7 @@
#include <iostream>
#include <exception>
#include <type_traits>
enum SpellCastResult
{
@ -29,9 +30,23 @@ Continuable<SpellCastResult> CastSpell(int id)
int main(int argc, char** argv)
{
shared_callback_of_t<Callback<int>> sc1;
weak_callback_of_t<Callback<bool>> sc2;
auto lam = [=](Callback<SpellCastResult>&& callback)
{
// on success call the callback with SPELL_FAILED_SUCCESS
callback(SPELL_FAILED_SUCCESS);
};
// static_assert(std::is_void<decltype(lam)>::value, "blub");
fu::function_type_of_t<decltype(lam)> fun1;
fun1 = lam;
fun1(Callback<SpellCastResult>());
fu::function_type_of_t<Callback<int>> fun2;
shared_callback_of_t<Callback<int>> fun3;
weak_callback_of_t<Callback<int>> fun4;
// make_weak_wrapped_callback(sc1);
// make_weak_wrapped_callback(sc2);