Easiest way to explain what I mean is with a code sample. This doesn't compile, but is there any way to achieve this effect:
foreach(Type someType in listOfTypes)
{
SomeMethod<someType>();
}
Would be really convenient if that would work, but it doesn't. Is there another way to achieve the same thing as above, and why doesn't C# allow for that to be a legal statement?
Edit: Seems like the only way to do this is via reflection which may be too slow for our needs. Any insight on why there's not an efficient way built in and whether something like this is in the works for C# 4.0?