diff --git a/src/UtilsCtrl/ThreadPool/UThreadPool.h b/src/UtilsCtrl/ThreadPool/UThreadPool.h index ce0d6b6..3783630 100644 --- a/src/UtilsCtrl/ThreadPool/UThreadPool.h +++ b/src/UtilsCtrl/ThreadPool/UThreadPool.h @@ -65,7 +65,7 @@ public: template auto commit(const FunctionType& func, CIndex index = CGRAPH_DEFAULT_TASK_STRATEGY) - -> std::future::type>; + -> std::future()())>; /** * 根据优先级,执行任务 @@ -78,7 +78,7 @@ public: template auto commitWithPriority(const FunctionType& func, int priority) - -> std::future::type>; + -> std::future()())>; /** * 执行任务组信息 diff --git a/src/UtilsCtrl/ThreadPool/UThreadPool.inl b/src/UtilsCtrl/ThreadPool/UThreadPool.inl index 61f749c..7485df7 100644 --- a/src/UtilsCtrl/ThreadPool/UThreadPool.inl +++ b/src/UtilsCtrl/ThreadPool/UThreadPool.inl @@ -15,8 +15,8 @@ CGRAPH_NAMESPACE_BEGIN template auto UThreadPool::commit(const FunctionType& func, CIndex index) --> std::future::type> { - using ResultType = typename std::result_of::type; +-> std::future()())> { + using ResultType = decltype(std::declval()()); std::packaged_task task(func); std::future result(task.get_future()); @@ -43,8 +43,8 @@ auto UThreadPool::commit(const FunctionType& func, CIndex index) template auto UThreadPool::commitWithPriority(const FunctionType& func, int priority) --> std::future::type> { - using ResultType = typename std::result_of::type; +-> std::future()())> { + using ResultType = decltype(std::declval()()); std::packaged_task task(func); std::future result(task.get_future());