C# Language C# 4.0 Features Optional ref keyword when using COM

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

The ref keyword for callers of methods is now optional when calling into methods supplied by COM interfaces. Given a COM method with the signature

void Increment(ref int x);

the invocation can now be written as either

Increment(0); // no need for "ref" or a place holder variable any more


Got any C# Language Question?