diff --git a/include/thread_pool.h b/include/thread_pool.h index 5139a91..b95e7f5 100644 --- a/include/thread_pool.h +++ b/include/thread_pool.h @@ -16,8 +16,6 @@ #ifndef OHOS_RESTOOL_THREAD_POOL_H #define OHOS_RESTOOL_THREAD_POOL_H -#include "no_copy_able.h" - #include #include #include @@ -30,14 +28,14 @@ namespace OHOS { namespace Global { namespace Restool { -class ThreadPool : public NoCopyable { +class ThreadPool{ public: /** * @brief Creates a thread pool with specify thread count * @param threadCount the count of threads to be created */ explicit ThreadPool(const size_t threadCount); - ~ThreadPool() override; + ~ThreadPool(); /** * @brief Start the thread pool @@ -55,7 +53,7 @@ public: * @param args the args of the function */ template - auto Enqueue(F &&f, Args &&...args) -> std::future::type>; + std::future::type> Enqueue(F &&f, Args &&...args); private: void WorkInThread(); @@ -69,7 +67,7 @@ private: }; template -auto ThreadPool::Enqueue(F &&f, Args &&...args) -> std::future::type> +std::future::type> ThreadPool::Enqueue(F &&f, Args &&...args) { using return_type = typename std::result_of::type; using p_task = std::packaged_task;