How does the assignment of the null literal to a System.Nullable type get handled by .Net (C#)?

后端 未结 5 1784
情深已故
情深已故 2021-01-13 13:35

I was wondering if anyone knows how the C# compiler handles the following assignment:

int? myInt = null;

My assumption is that there is an

5条回答
  •  一生所求
    2021-01-13 13:37

    Something like:

    public Nullable() {
        this.value = default(T);
        this.hasValue = false;
    }
    

提交回复
热议问题