Ideally I would choose something like this:
enum typeIndex{ byte = 0, ubyte, short, ushort, int, uint } char[6] typechars="cCsSiI"; bool check(T)(char c){ return typechars[typeIndex(typeof(T))]==c; } Though I know this is implementation is not remotely correct D.