diff --git a/source/vibe/core/core.d b/source/vibe/core/core.d index 62a0890..4f9c0d6 100644 --- a/source/vibe/core/core.d +++ b/source/vibe/core/core.d @@ -314,8 +314,18 @@ void setIdleHandler(bool delegate() @safe nothrow del) 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) - 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); }); }