J
Jon Skeet [C# MVP]
NaughtDivisor said:OK. One simplified question, one question whose solution is alluding
me.
1.) How does one pass, as an argument, a constrained generic class to
a method in a non-generic class?
The constraint part is irrelevant. You pass it as normal, but it will
depend on the method. (In fact, you never pass a generic class - you
pass an instance, or rather a reference to an instance.)
Could you give an example of what you mean? Bear in mind that a method
in a non-generic class can still be a generic method.
If you can give an example you've found which works *without* a
constraint, but you're having trouble *with* the constraint, I'm sure
we can help you.
2.) How does one pass, as an argument, a constrained generic class to
a delegate field in a non-generic class?
You don't "pass" anything to a field. You can assign values, although
that should be done within the class.
Again, what is your actual objective? Why do you still need (or think
you need) it to be generic in the non-generic class?
I guess I really should have compiled that example...that's