This is a "hello world" of C++11 threading.
I'm not sure what this is doing on HN.
I'm not sure what this is doing on HN.
using return_type = typename std::result_of<F(Args...)>::type
though. using return_type = decltype(f(args...));
seems easier to read and "more C++11".Also the "> >" is a pre-C++11 pattern.
result_of has now been deprecated in newer C++ versions but since this advertises itself as C++11 thread pool I intend to leave it as is.