Is it possible in C# to create an array of unspecified generic types? Something along the lines of this:
ShaderParam<>[] params = new ShaderParam<&g
That wouldn't make sense.
What would happen if you write params[3]
?
What type would it be?
You may want to create a non-generic base class or interface and use an array of them.
No, the concept ShaderParam<>
is meaningless as far as an instantiated type is concerned. In other words, a concrete ShaderParam<float>
is not an instance of ShaderParam<>
. Therefore, the declared type of the array would be illegal for holding that instance. (Above and beyond the fact that it's already illegal syntax to begin with.)