المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : What does this code segment mean??



C# Programming
10-29-2011, 02:42 AM
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