Does passing a value type in an “out” parameter cause the variable to be boxed?

后端 未结 4 1774
长发绾君心
长发绾君心 2020-12-11 01:27

I\'m aware that boxing and unboxing are relatively expensive in terms of performance. What I\'m wondering is:

Does passing a value type to a method\'s out

4条回答
  •  孤街浪徒
    2020-12-11 02:10

    There is no boxing; what the out parameter does is specifies that number must be assigned to within the TryParse method. Irrespective of this, it is still treated as an int, not an object.

提交回复
热议问题