-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Extend null-conditional (?., ?[]) and null-coalescing (??) operators to pointers #398
Comments
This is half of a duplicate of #323. |
@svick |
When I proposed #323 I completely forgot about null-conditional operators. Obviously it would be nice if both null-conditional and null-coalescing operator worked also for pointer types. Note that null-coalescing operator is already supported by VS2017 quick actions. VS2017 hints that it could be simplified to use null-coalescing operator even though resulting code does not compile. unsafe byte* SomeFunc(byte* p, byte* defaultVal)
{
return p != null ? p : defaultVal;
} |
I've queued this to be considered by the LDM at #418. |
I'd like to be able to write:
The above should compile to the equivalent of the following:
The text was updated successfully, but these errors were encountered: