Added overload of Task::StartNew() to support void-returning member functions.

This commit is contained in:
intolerantape
2021-12-03 07:53:03 -08:00
parent 8d758ced15
commit 25deea220c

View File

@@ -248,6 +248,19 @@ public:
/// <returns>Task</returns>
static Task* StartNew(Function<void()>::Signature action, Object* target = nullptr);
/// <summary>
/// Starts the new task.
/// </summary>
/// <param name="callee">The callee object.</param>
/// <returns>Task</returns>
template<class T, void(T::* Method)()>
static Task* StartNew(T* callee)
{
Function<void()> action;
action.Bind<T, Method>(callee);
return StartNew(action, dynamic_cast<Object*>(callee));
}
/// <summary>
/// Starts the new task.
/// </summary>