Add runTask overloads to make lambda argument inference work.
This commit is contained in:
parent
897c43051f
commit
de718c4b1c
|
@ -314,8 +314,18 @@ void setIdleHandler(bool delegate() @safe nothrow del)
|
||||||
|
|
||||||
Note that the maximum size of all args must not exceed `maxTaskParameterSize`.
|
Note that the maximum size of all args must not exceed `maxTaskParameterSize`.
|
||||||
*/
|
*/
|
||||||
|
Task runTask(ARGS...)(void delegate(ARGS) @safe task, auto ref ARGS args)
|
||||||
|
{
|
||||||
|
return runTask_internal!((ref tfi) { tfi.set(task, args); });
|
||||||
|
}
|
||||||
|
///
|
||||||
|
Task runTask(ARGS...)(void delegate(ARGS) @system task, auto ref ARGS args)
|
||||||
|
@system {
|
||||||
|
return runTask_internal!((ref tfi) { tfi.set(task, args); });
|
||||||
|
}
|
||||||
|
/// ditto
|
||||||
Task runTask(CALLABLE, ARGS...)(CALLABLE task, auto ref ARGS args)
|
Task runTask(CALLABLE, ARGS...)(CALLABLE task, auto ref ARGS args)
|
||||||
if (is(typeof(CALLABLE.init(ARGS.init))))
|
if (!is(CALLABLE : void delegate(ARGS)) && is(typeof(CALLABLE.init(ARGS.init))))
|
||||||
{
|
{
|
||||||
return runTask_internal!((ref tfi) { tfi.set(task, args); });
|
return runTask_internal!((ref tfi) { tfi.set(task, args); });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue