Don Box has this example about the upcoming C# support for generics:
CLR generics that use members of a type parameter require an explicit predicate on the parameter to ensure that no runtime checks will need to be done.Here's an example of how this works in C#:
class Bob where T : IHasG {
T t;
public : void f() { t.g(42); }
};
which assumes an IHasG interface that looks more or less like this:
public interface IHasG {
void g(int);
}
which I find awfully disappointing. Not having to have classes derive from a specific abstract base class in C++ to do this has always been one of my favorite C++ features.
that’s wrong. generics in C# do not require such an explicite predicate on the parameter, which is called constraint, they can optionally have one more oh them. have a look at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbconcprogramminglanguagefuturefeatures.asp