#pragma once #include "Task.h" class TaskFactory { template static T TaskResultToResultType(TaskResult arg); public: template static auto Create(const FuncType& function) { return FuncTask(function); } template static auto CreateOnHeap(const FuncType& function) -> Task* { return new FuncTask(function); } template static auto CreateOnHeapUnique(const FuncType& function) -> std::unique_ptr> { return std::make_unique>(function); } };