Created
May 15, 2023 18:07
-
-
Save 5cover/2287f67434e3ddd1612875b4eeeb741c to your computer and use it in GitHub Desktop.
C# Reference wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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