Re: Generics without direct instantiation

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Mark Rae <mark@xxxxxxxxxxxxxxxxx> wrote:
This is just for my own interest - I don't actually want to do it, I'm just
curious to know if it's possible...

<snip>

Could we also do something like MyMethod(new Dictionary<string,
string>(...................);

I'm not sure exactly what you're asking. You could certainly call
MyMethod(new Dictionary<string,string>());

or use any of the other constructors of Dictionary<K,V> - but there
aren't any constructors which take an IEnumerable in the same way that
List<T> does.

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.



Relevant Pages