Say I want to make a function to test sorting algorithms, Every sorting algorithm has the signature:
fn sort(comptime T: type, arr: []T) void
The testing function then has signature:
fn testSort(sort: fn (comptime T: type, arr: []T) void
However, Zig complains that T
is not declared in arr: []T
. What do I need to do to achieve something like this?