Login
Какой смысл арифметических операций с нулем?
2189 просмотров
Перейти к просмотру всей ветки
in Antwort AlexNek 18.06.23 13:47
Похоже нашлось
http://zuga.net/articles/cs-what-are-lifted-operators/
int? ten = 10; int? twenty = 20; // result.Value is 30 int? result = ten + twenty;
Without lifted operators, the compiler would report:
Error CS0019 Operator '+' cannot be applied to operands of type 'Nullable<int>' and 'Nullable<int>'.
Но проблемы доставляют
https://mfranc.com/blog/something-null-is-false-c-and-lift...
if (data.CreateDate => this.LastUpdateDate) { DoSomething(); }