Skip to content

Champion "conditional ref operator" (C# 7.2) #223

@gafter

Description

@gafter

See also

The idea would be to support a version of the ?: operator that yields an lvalue. The current proposal is to do so using ref after the : and ?, for example

   (array1 != null ? ref array1[index] : ref dummy) = value;
   ref Node next = ref (node != null) ? ref node.Next : ref head;

Metadata

Metadata

Assignees

Labels

Implemented Needs ECMA SpecThis feature has been implemented in C#, but still needs to be merged into the ECMA specificationProposal champion

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions