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 <orgads@gmail.com>
This commit is contained in:
Eike Ziller
2016-07-07 11:28:24 +02:00
parent 4f13f074d9
commit 4133ff0ab6
3 changed files with 8 additions and 5 deletions

View File

@@ -155,6 +155,9 @@ struct functionTraits<Callable&&> : public functionTraits<Callable>
{
};
template <typename F>
using functionResult_t = typename functionTraits<F>::ResultType;
////////////////////
// functionTakesArgument
////////////////////

View File

@@ -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)
{

View File

@@ -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>