generics covariance/contravariance support in C# [2]
Further to my last post on generics covariance/contravariance support in C# I have been researching this a bit more. I ran into this research paper that discusses a way of adding support to C# and suggests that a patch might be created for Rotor 2.0 so you can see this in action, does anyone know if this has been done? It seems that while the CLI supports generic covariance/contravariance I can't beyond Eiffel any .NET languages that support it (if you do know of any let me know), while cool I am not sure if Eiffel is free and for OSS purposes I can't afford it :)
One way of getting around this in C# is to use the CopyAll function, see this post on how. However note Rick Byers advice on this.
[CopyAll creates] a NEW list, calling the conversion function for EACH element, and storing the resulting element into the new list. This is not the same thing as [generic covariance/contravariance]. First of all, copying the whole list to a new list takes time and space proportional to the size of the list.