...there's probably more advanced helper functions in the same std.meta.trait module, I haven't explored that yet.
Also, disclaimer: I haven't dabbled much yet with Zig generics, don't know if this is the proper style (in this case it's probably better to get rid of T entirely and just use anytype for the obj argument).