I tried this earlier today:
public interface IFoo
{
IEnumerable GetItems_A( ref int somethingElse );
IEnumerable GetItems_B( ref in
Others have explained why your iterator can't have a ref parameter. Here's a simple alternative:
public interface IFoo
{
IEnumerable GetItems( int[] box );
...
}
public class Bar : IFoo
{
public IEnumerable GetItems( int[] box )
{
int value = box[0];
// use and change value and yield to your heart's content
box[0] = value;
}
}
If you have several items to pass in and out, define a class to hold them.