LuaFunction.call

Call this function.

struct LuaFunction
T
call
(
T = void
U...
)
()

Parameters

T

expected return type.

args U

list of arguments.

Return Value

Type: T

Return value of type T, or nothing if T was unspecified. See $(DPMODULE2 conversions,functions) for how to catch multiple return values.

Examples

lua.doString(`function ask(question) return 42 end`);
auto ask = lua.get!LuaFunction("ask");

auto answer = ask.call!int("What's the answer to life, the universe and everything?");
assert(answer == 42);

Meta