ThreadPool icon indicating copy to clipboard operation
ThreadPool copied to clipboard

Replacing `std::result_of` with `decltype`

Open andrevis opened this issue 5 years ago • 4 comments

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

andrevis avatar Sep 18 '20 09:09 andrevis

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.

fogti avatar Sep 19 '20 20:09 fogti

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

andrevis avatar Sep 21 '20 08:09 andrevis

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.

fogti avatar Sep 26 '20 17:09 fogti

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

Qix- avatar Apr 18 '22 22:04 Qix-