ThreadPool icon indicating copy to clipboard operation
ThreadPool copied to clipboard

Compile warning

Open mxwendler opened this issue 2 years ago • 1 comments

Hi there, thank you very much for this powerful, simple and impressively compact library! Just a minor issue, we get compile warnings under clang 14:

/xxx/libs/cpp/threadpool/threadpool.hpp:177:28: warning: explicitly defaulted move assignment operator is implicitly deleted [-Wdefaulted-function-deleted]
            DispatchGroup& operator = (DispatchGroup&& DP) = default;
                           ^
/xxx/libs/cpp/threadpool/threadpool.hpp:240:31: note: move assignment operator of 'DispatchGroup' is implicitly deleted because field '_closed' has a deleted move assignment operator
            std::atomic<bool> _closed;
                              ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/atomic:73:13: note: 'operator=' has been explicitly marked deleted here
    atomic& operator=(const atomic&) = delete;

So to my understanding we could simply remove the move operator from the default assignment:

- DispatchGroup& operator = (DispatchGroup&& DP) = default;
------
+ DispatchGroup& operator = default;

Best wishes

mxwendler avatar Mar 25 '23 10:03 mxwendler

Hi! Thanks for your feedback, please, feel free to open a pull request with this mod and I will merge it in the master branch!

alice-viola avatar Mar 26 '23 06:03 alice-viola