class FGenericTask { TSomeType SomeArgument; public: FGenericTask(TSomeType InSomeArgument) // CAUTION!: Must not use references in the constructor args; use pointers instead if you need by reference : SomeArgument(InSomeArgument) { / Usually the constructor doesn't do anything except save the arguments for use in DoWork or GetDesiredThread. } ~FGenericTask() { / you will be destroyed immediately after you execute. Might as well do cleanup in DoWork, but you could also use a destructor. } FORCEINLINE TStatId GetStatId() const { RETURN_QUICK_DECLARE_CYCLE_STAT(FGenericTask, STATGROUP_TaskGraphTasks); }