Added overload of Task::StartNew() to support void-returning member functions.
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user