Is enum int int listing expensive?

Since enumerations are a type of values ​​and internal integers, is it less expensive to translate them to int than is usually done?

If it is faster, is it because it is a value type and not a reference type?

+4
source share
1 answer

No, because of how it stores the value inside. C # has almost no overhead. The overhead during casting is largely related to the amount of code needed to switch from one type to another, whether a new object should be created and memory allocated, etc.

+2
source

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


All Articles