Commit 4133ff0a authored by Eike Ziller's avatar Eike Ziller

Add functionResult_t as convenience for using functionTraits

Allows
  functionResult_t<F>
instead of
  typename functionTraits<F>::ResultType

Change-Id: Ia85973a890303c38b598e25b2a476f659fc5c359
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 4f13f074
......@@ -155,6 +155,9 @@ struct functionTraits<Callable&&> : public functionTraits<Callable>
{
};
template <typename F>
using functionResult_t = typename functionTraits<F>::ResultType;
////////////////////
// functionTakesArgument
////////////////////
......
......@@ -243,7 +243,7 @@ protected:
};
template <typename ResultType, typename Function, typename... Args>
typename functionTraits<Function>::ResultType
functionResult_t<Function>
callWithMaybeFutureInterfaceDispatch(std::false_type, QFutureInterface<ResultType> &,
Function &&function, Args&&... args)
{
......@@ -251,7 +251,7 @@ callWithMaybeFutureInterfaceDispatch(std::false_type, QFutureInterface<ResultTyp
}
template <typename ResultType, typename Function, typename... Args>
typename functionTraits<Function>::ResultType
functionResult_t<Function>
callWithMaybeFutureInterfaceDispatch(std::true_type, QFutureInterface<ResultType> &futureInterface,
Function &&function, Args&&... args)
{
......@@ -259,7 +259,7 @@ callWithMaybeFutureInterfaceDispatch(std::true_type, QFutureInterface<ResultType
}
template <typename ResultType, typename Function, typename... Args>
typename functionTraits<Function>::ResultType
functionResult_t<Function>
callWithMaybeFutureInterface(QFutureInterface<ResultType> &futureInterface,
Function &&function, Args&&... args)
{
......
......@@ -98,7 +98,7 @@ struct resultTypeWithArgument<Function, QFutureInterface<ResultType>&>
template <typename Function, typename Arg>
struct resultTypeWithArgument
{
using type = typename functionTraits<Function>::ResultType;
using type = functionResult_t<Function>;
};
template <typename Function, int index>
......@@ -110,7 +110,7 @@ struct resultTypeTakesArguments<Function, index, true>
template <typename Function, int index>
struct resultTypeTakesArguments<Function, index, false>
{
using type = typename functionTraits<Function>::ResultType;
using type = functionResult_t<Function>;
};
template <typename Function>
......
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