Re: Generics Question



I don't know Jon, that's why I asked the question.


"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.21b136d1df3e7170641@xxxxxxxxxxxxxxxxxxxxxxx
Scott M. <smar@xxxxxxxxxxxxx> wrote:
Why not? If I use a paremeterized constructor that asks for a type that
is
an interface, wouldn't that work?

How would you build an equivalent of List<T> using interfaces, such
that you get the same kind of compile-time type safety?

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk


.



Relevant Pages

  • Re: What is the point of IDisposable?
    ... Good point, Jon. ... Of course, it goes hand-in-hand with my answer, as the ... using method depends upon the interface being there in order to work. ... > and Dispose will be called automatically. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Rules stopped working
    ... Again, I _assume_ you're responding to my last post, but it makes life very ... difficult for folks who just happen upon your posts when those posts are ... Jon is using the Microsoft web-based user interface to this newsgroup. ...
    (microsoft.public.mac.office.entourage)
  • Re: Delegates or events ?
    ... > GTi wrote: ... > *use* the interface, I suspect. ... >> But I have problem understanding how this can be done. ... Jon, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: delegate in interfaces vb.net vs c#
    ... Thanks Jon. ... delegate 'handler' and execute this event... ... Public Interface Interface1 ... Interfaces don't allow nested types at all in C#, ...
    (microsoft.public.dotnet.framework)
  • Re: Interface Question
    ... > where Jon Skeet was going, and intellectually accept what he pointed ... > Here's my real problem: I've got a browser.Document object, ... > interface, and this seems silly. ... if I have a method parameter of type IList, I can pass the value I'm ...
    (microsoft.public.dotnet.languages.csharp)

Loading