progschj / ThreadPool

A simple C++11 Thread Pool implementation
zlib License
7.63k stars 2.21k forks source link

Replacing `std::result_of` with `decltype` #81

Open andrevis opened 3 years ago

andrevis commented 3 years ago

result_of and its helper type result_of_t are deprecated as of C++17

fogti commented 3 years ago

Did the implementation work? Does it work even with C++11, or is there something preventing that? If it does in fact work with C++11, I would merge it into my fork.

andrevis commented 3 years ago

Did the implementation work? Does it work even with C++11, or is there something preventing that? If it does in fact work with C++11, I would merge it into my fork.

Yes, it is. It seems ok with C++11 too. Here is a short demo (check C++11 in options): http://cpp.sh/4rsyb

fogti commented 3 years ago

I merged the concept into my fork in commit https://github.com/zserik/ThreadPool/commit/b7d0acb9b3ab3f4746a1d151525d1201bc29eea7. I don't think this PR itself is going to be merged bc the repository seems to be abandoned since the beginning of 2015.

Qix- commented 2 years ago

For anyone looking for a C++17 fix for this that doesn't use decltype (which didn't work in all cases for me), check this commit: https://github.com/Qix-/ThreadPool/commit/113efd5e29858e571cd7586552032aab272d2d79