Replies: 4 comments
-
From @aluanhaddad on October 11, 2015 22:35 This makes sense. If |
Beta Was this translation helpful? Give feedback.
-
Would #328 be of use here? I have already implemented that into Roslyn as a default-coalescing-operator. Haven't tried though whether it also works for pointers. Update: |
Beta Was this translation helpful? Give feedback.
-
Default value for pointer types is null so your proposal would fit here. |
Beta Was this translation helpful? Give feedback.
-
I've queued this to be considered by the LDM at #418. |
Beta Was this translation helpful? Give feedback.
-
From @jacekbe on October 11, 2015 11:6
I realize that pointers in C# are not the most widely used construct but they exist and it would be nice if null coalescing operator worked for pointer types as well so we could write:
T *p1 = p2 ?? p3;
instead of:
T *p1 = p2 != null ? p2 : p3;
Copied from original issue: dotnet/roslyn#5869
Beta Was this translation helpful? Give feedback.
All reactions