Inlined IsValid for "ostreamable" enum classes.