0
Answer

generics type instantiation

Ask a question
George George

George George

16y
1.9k
1

Hello everyone,


In C++ template, the type parameter will be deduced when we use it, and compiler will generate the speicifc version of template function/class -- called instantiation.

In C#, it is also compiler will do the instantiation at compile time other than runtime? For example, if we use int and string for List<T>, then two versions of List class, List<int> and List<string> will be generated in IL -- which will make IL bigger? :-)


thanks in advance,
George