Re: How do I use Generics with interfaces?
- From: Tom Spink <tspink@xxxxxxxxx>
- Date: Sat, 23 Jun 2007 14:29:24 +0100
MrNobody wrote:
"AlexS" wrote:
Is that what you are talking about?
close,
like this:
class MyObject : IMyInterface { ... }
....
public void doSomething(List<IMyInterface> list) { ... }
....
List<MyObject> list = new List<MyObject>();
doSomething(list);
Hi,
So we've already discussed that this isn't possible, due to the lack of
support for generic covariance. But array covariance *is* supported, have
you had any luck trying this?
--
Tom Spink
University of Edinburgh
.
- References:
- Re: How do I use Generics with interfaces?
- From: PS
- Re: How do I use Generics with interfaces?
- From: AlexS
- Re: How do I use Generics with interfaces?
- Prev by Date: Re: FxCop being a bit OTT?
- Next by Date: Re: How to ? out argument in managed c++
- Previous by thread: Re: How do I use Generics with interfaces?
- Next by thread: Encapsulation philosophy question
- Index(es):
Relevant Pages
|