Last post Aug 06, 2014 08:48 AM by gerrylowry
Member
94 Points
171 Posts
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?
Thanks!
All-Star
120146 Points
27989 Posts
Moderator
MVP
Aug 06, 2014 08:46 AM|ignatandrei|LINK
same
Star
14297 Points
5797 Posts
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.
Member
94 Points
171 Posts
Difference between where T : x, y and where T : x where T : y
Aug 06, 2014 08:35 AM|mindominiscient|LINK
Here is a piece of code that I want to understand their difference. Its Generics.
What is the difference the above two codes? Do they mean the same thing?
Thanks!
All-Star
120146 Points
27989 Posts
Moderator
MVP
Re: Difference between where T : x, y and where T : x where T : y
Aug 06, 2014 08:46 AM|ignatandrei|LINK
same
Star
14297 Points
5797 Posts
Re: Difference between where T : x, y and where T : x where T : y
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.