Skip to content
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

Null-coalescing assign operator #10908

Closed
zdimension opened this issue Apr 27, 2016 · 1 comment
Closed

Null-coalescing assign operator #10908

zdimension opened this issue Apr 27, 2016 · 1 comment

Comments

@zdimension
Copy link

Currently, C# has got a lot of op-assign operators like +=, -=, etc.
One that would be useful is ??=. (null-coalescing).
It would work like this:

a ??= b;

The code above would simply mean:

a = a ?? b;

or

if (a == null)
    a = b;
@bbarry
Copy link

bbarry commented Apr 27, 2016

#205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants