how are nullable types implemented under the hood in .net?
Ultimately, they are just a generic struct with a bool flag – except with special boxing rules. Because structs are (by default) initialized to zero, the bool defaults to false (no value): public struct Nullable<T> where T : struct { private readonly T value; private readonly bool hasValue; public Nullable(T value) { this.value = value; … Read more