test169

Undocumented in source.
immutable
@TestInfo(&tester169, [HostSymbol("printStr", cast(void*)&external_print_string), HostSymbol("printInt", cast(void*)&external_print_i64_func)])
auto test169 = q{--- test169 // #foreach with multiple statements @extern(module, "host") void printStr(u8[]); @extern(module, "host") void printInt(i64 i); $alias selectPrintFunc($type T) { if ($isInteger(T)) return printInt; if ($isSlice(T)) return printStr; $compileError("Invalid type"); } void write[Args...](Args... args) { #foreach(i, arg; args) { alias func = selectPrintFunc(Args[i]); func(arg); } } void run() { write("Hello", 42); } };

Meta