Skip to content

Instantly share code, notes, and snippets.

@5cover
Created May 15, 2023 18:07
Show Gist options
  • Save 5cover/2287f67434e3ddd1612875b4eeeb741c to your computer and use it in GitHub Desktop.
Save 5cover/2287f67434e3ddd1612875b4eeeb741c to your computer and use it in GitHub Desktop.
C# Reference wrapper
public sealed class Ref<T>
{
public Ref(T value) => Value = value;
public T Value { get; set; }
public static implicit operator T(Ref<T> @ref) => @ref.Value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment