Commit 08457143 authored by Eike Ziller's avatar Eike Ziller

runAsync: Fix build issue with MSVC2015

MSVC2015 has a bug that reference_wrappers have a call operator even if
the wrapped object isn't callable.

Change-Id: I02d96712418f55470034098caab5a61f687194ac
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
parent d9660c84
......@@ -143,7 +143,7 @@ struct resultTypeHasCallOperator<Function, false>
template <typename Callable>
struct resultTypeHasCallOperator<Callable, true>
: public resultTypeTakesArguments<decltype(&Callable::operator()), 1, (functionTraits<decltype(&Callable::operator())>::arity > 1)>
: public resultTypeTakesArguments<Callable, 0, (functionTraits<Callable>::arity > 0)>
{
};
......@@ -168,6 +168,17 @@ struct resultType<Function &&> : public resultType<Function>
{
};
// work around bug in MSVC 2015 where a reference_wrapper has a call operator even if the wrapped
// object doesn't
template <typename Function>
struct resultType<std::reference_wrapper<Function>> : public resultType<Function>
{
};
template <typename Function>
struct resultType<std::reference_wrapper<const Function>> : public resultType<Function>
{
};
/*
Callable object that wraps a member function pointer with the object it
will be called on.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment