Allow PostTask() to take unique_ptr to classes derived of QueuedTask
Problem fixed by this CL: Let DerivedQueuedTask be a custom derivation of QueuedTask. Calling PostTask() with a std::unique_ptr<DerivedQueuedTask> does not work, because overload resolution sees PostTask(const Closure& closure) as a better match. The workaround of explicitly converting to std::unique_ptr<QueuedTask> before calling PostTask() results in less readable code.
Solution: Use std::enable_if to limit the template, thereby making the compiler use the right version of PostTask().
1 file changed