Generic method which should only work for reference types

Hi, I have wrote the generic method as below. I don't want it to be used for value types, only for reference types. What do I replace the question marks with? I tried both object and Object, but the compiler does not allow that.



public <T> GetSomething<T>(string parameter) where T: ?
{
T temp =null;

if(.......)
{
doSomething();
}

return temp;
}

[750 byte] By [BartCoppens] at [2007-12-16]
# 1
The word you're looking for is "class". And if you'd need to constrain T to value type you'd use "struct".
ChrisNahr at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...