Last post Aug 06, 2014 08:48 AM by gerrylowry
Aug 06, 2014 08:35 AM|mindominiscient|LINK
Here is a piece of code that I want to understand their difference. Its Generics.
static T ProduceA<T>() where T : IEnumerable, IComparable
static T ProduceA<T>() where T : IEnumerable where T : IComparable
What is the difference the above two codes? Do they mean the same thing?
Aug 06, 2014 08:46 AM|ignatandrei|LINK
Aug 06, 2014 08:48 AM|gerrylowry|LINK
AFAIK, they're the same ... you're first example is just less typing.
Good artticle here:
http://msdn.microsoft.com/en-us/library/ms379564%28v=vs.80%29.aspx has many examples of where constraint.