Skip to content

Instantly share code, notes, and snippets.

@controlflow
Created January 26, 2017 12:42
Show Gist options
  • Save controlflow/b2af07fd1ccc170cadcf9e4bdb0910aa to your computer and use it in GitHub Desktop.
Save controlflow/b2af07fd1ccc170cadcf9e4bdb0910aa to your computer and use it in GitHub Desktop.
public delegate ref int RefIntFunc();
public delegate ref T RefFunc<T>();
public delegate ref TReturn RefFunc<T, TReturn>(T arg);
public delegate ref TReturn RefFunc<T1, T2, TReturn>(T1 arg1, T2 arg2);
public interface IWithRefReturns {
ref int RefIntMethod();
ref string RefStringMethod();
ref int RefIntProperty { get; }
ref object this[int key] { get; }
}
public interface ISpan<T> {
ref T this[int index] { get; }
}
public abstract class WithRefReturns : IWithRefReturns {
public abstract ref int RefIntMethod();
public abstract ref string RefStringMethod();
public abstract ref int RefIntProperty { get; }
public abstract ref object this[int key] { get; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment