What does this code segment mean??
-
I had a class written like this:
public void Set(string key, T value)
{
if(value == null)
{
return;
}
...
}I'm using "reSharper" however within my visual studio (for those who don't know, resharper is a great little tool that helps clean up code and suggests better ways of writing it. Highly recomend it) to help clean up my code, and ReSharper suggested I write the first line of the above code in the following manner:
public void Set(string key, T value) where T : class
What does this "where T : class" mean? I don't understand what it does. Thanks
-
I had a class written like this:
public void Set(string key, T value)
{
if(value == null)
{
return;
}
...
}I'm using "reSharper" however within my visual studio (for those who don't know, resharper is a great little tool that helps clean up code and suggests better ways of writing it. Highly recomend it) to help clean up my code, and ReSharper suggested I write the first line of the above code in the following manner:
public void Set(string key, T value) where T : class
What does this "where T : class" mean? I don't understand what it does. Thanks