Lifted operators work between value types and the nullable forms of those types.
Any operator that is valid on type T, will be lifted to work between T and Nullable<T>, or between Nullable<T> and Nullable<T>.
In plain english: You can add a Nullable<int>
and Nullable<int>
even though the Nullable class does not define a plus operator.
E.g.
Without lifted operators, the compiler would report:
Error CS0019 Operator '+' cannot be applied to operands of type 'Nullable<int>' and 'Nullable<int>'.
You can confirm this by writing a MyNullable<T> class that is identical to Nullable (using the decompiled F12 metadata, or the .NET Reference Source).
In the above example, the C# compiler will lift the available plus operator, and rewrite the statement as follows:
Note that lifted operators are a feature of the compiler, and not of the runtime.
Finally, if either value is null, the result is null.