Generics vs. Boxing

Possible duplicate:
Do common interfaces in C # provide a box? (.NET Performance vs. Mono)

I have one quick question ... using generics, do I completely get rid of boxing / unpacking operations?

For example, when using a list, do I still get a lot of boxing / unboxing?

I read several documents on the Internet, but could not solve this specific question ...

+3
source share
2 answers

, . " " , .

+6

, : , .

,

List<int> table = new List<int>();
table.Add(1);
int x = table[0];

/.

+6

Source: https://habr.com/ru/post/1736407/


All Articles