I just wondered, how the exact syntax is for ref
and out
parameters for delegates and inline lambda functions.
here is an example
i
You need to define a new delegate type for this method signature:
delegate void RefAction(ref T obj);
public void F()
{
RefAction f2 = DoSomething;
int x = 0;
f2(ref x);
}
The reason why the .NET Framework does not include this type is probably because ref
parameters are not very common, and the number of needed types explodes if you add one delegate type for each possible combination.