Code such as this will fail in template deduction:
auto member_task = TP.enqueue(&MyClass::member_func, this);
std::result_of uses std::declval to get the proper result.
Changing the declaration of ThreadPool::enqueue to:
template <class F, class... Args>
auto enqueue(F&& f, Args&&... args)
-> std::future<typename std::result_of<F(Args...)>::type>;
allows the above to compile. Similarly change the typedef inside the definition.
If I felt I had more expertise in template metaprogramming, I would have submitted a patch. But I may have omitted std::forward in places where it matters.