April 2013
Intermediate to advanced
1700 pages
92h 51m
English
Not surprisingly, given the existing physical representation of value types and reference types, nullable value types are represented precisely as an encapsulation of this pattern (but one both the runtime and various languages such as C# know about).
Let’s start on the lowest level with the runtime. Given a value type, which intrinsically can’t accommodate for the null value, how do we create its nullable counterpart? The answer is Nullable<T>, a generic type where T is the type parameter that accepts a value type. Figure 4.38 dissects a nullable value in terms of a Boolean flag and an optional value of type T.
FIGURE ...
Read now
Unlock full access