Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Int32 overloads operators?

I quickly go through Int32 struct definition, and I do not find any overload to operators like + - * /, but for String class, we can directly find them. How does Int32 implement such feature?

like image 549
Bargitta Avatar asked Nov 01 '25 12:11

Bargitta


1 Answers

They are baked into the CLR, and are not part of the code outputted as Reference Source. Hence you can't find them.

For String, only two operators are visible: those written in C#. Those in the CLR are also not shown (like the + operator).

like image 136
Patrick Hofman Avatar answered Nov 03 '25 01:11

Patrick Hofman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!