How does "comptime continue" work?
Ziggit
How does "comptime continue" work?
I’ve been writing some code using inlined loops to introspect type fields. Removing all the actual logic, I end up with a pattern like this: inline for (@typeInfo(T).@"struct".fields) |field| { const key = comptime getKey(field); if(runtime_map.get(key)) |value| { // do something with value } } Preferring to use orelse to short circuit my loops, I got annoyed that this doesn’t work: inline for (@typeInfo(T).@"struct".fields) |field| { const key = comptime getKey(fiel...
I’ve been writing some code using inlined loops to introspect type fields. Removing all the actual logic, I end up with a pattern like this: inline for…
0 comments
No comments yet.