This may be a very basic question, but it still gets me confused (and Google can’t help) 😉 How can I pass a generic object as a parameter to a function?
For example I have a class CoolGeneric<T>
Now I need a method DoSomethingWithAGeneric(CoolGeneric g).
Here the compiler keeps on complaining that a concrete type parameter is necessary. But the method should work with all kinds of type parameters!
How can I do this? Thanks!
Simply :
Or if the method is within a class declaring the generic type :