What CLR do when compare T with null, and T is a struct?
- by Fujiy
private static void SaveOrRemove<T>(string key, T value)
{
if (value == null)
{
Console.WriteLine("Remove: " +key);
}
....
}
If I call passing 0 to value: SaveOrRemove("MyKey", 0), the condition (value == null) is false, then CLR dont make a (value == default(T)). What really happens?