There are two differences between using
where T : struct
and
where T : ValueType
- the latter would allow
Tto beValueTypeitself, which is a reference type. - the latter would also allow
Tto be a nullable value type
The first of these differences is almost never what you want. The second could occasionally be useful; Nullable<T> is slightly odd in that it satisfies neither the where T : struct nor where T : class constraint.
More useful would be the constraint
where T : struct, System.Enum
which is prohibited by C# for no good reason that I can tell. See my blog post and the Unconstrained Melody project for more on this.