#Tokenizing and iterating over a string at comptime
1 messages · Page 1 of 1 (latest)
You need to also mark the function call comptime:
inline while (comptime it.next()) ...
You could also put the entire thing in a comptime block, if you don't want to write comptime in front of everything:
comptime {
var it = std.mem.tokenize(u8, pattern, "*");
inline while (it.next()) |substr| {
// ...
}
}