I'm a bit surprised to find that calling the constructor in:
class MyClass<T>
{
public MyClass()
{
if ( default( T ) == null )
Debugger.Break();
}
}
doesn't break when T
is an enum type. Why? It seems that even for enums, default( T )
and null
should be equivalent.