Re: Cast generic IFoo<T> : last level (I hope)
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Fri, 25 Jul 2008 08:53:36 -0700
On Fri, 25 Jul 2008 05:29:01 -0700, Alphapage <Alphapage@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hello again,
My last question which opened a big debate about casting such a generic
interface learned me a lot, but I can't find a way because of my particular
generic interface.
I will shown you my code, but when you will answer my post, don't write:
- he is stupid (I already know)
- this is not Object Oriented
- generic is not made for that ...
Okay, I won't. :) Especially the first...I try very hard to never write things like that even when I know them to be true, and there's nothing here to suggest it is.
On the other two points, I guess it just remains to be seen. As Jon says, I don't think this code example clears things up much, if at all. In addition to his comment, I'll point out that I've never seen correct code where the type parameter is constrained to inherit the type in which it's being used.
It's possible that there's some esoteric use of generics that I'm unfamiliar with where it comes up, but the few times I've played around with that construct myself, I've gotten nowhere and coded myself into logical impossibilities. If you're sure that that's the right tack to take, you need to at least elaborate on _why_ you're declaring your generic classes that way.
Pete
.
- References:
- Cast generic IFoo<T> : last level (I hope)
- From: Alphapage
- Cast generic IFoo<T> : last level (I hope)
- Prev by Date: Re: Combobox Load Help Please
- Next by Date: Re: RamDrive
- Previous by thread: Re: Cast generic IFoo<T> : last level (I hope)
- Next by thread: Re: How to create a RamDrive?
- Index(es):
Relevant Pages
|