Created
September 12, 2017 10:30
-
-
Save jamesrswift/ec3cfd97e12195e2d94f7f9894353993 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 abstract class UntypedVariable{ | |
public abstract object ValueUntyped { get; } | |
} | |
public class UntypedVariable<T> : UntypedVariable { | |
private T Value; | |
public override object ValueUntyped{ get { return Value; } } | |
public UntypedVariable( T New ){ | |
Value = New; | |
} | |
static public implicit operator UntypedVariable<K>( K New ){ | |
return new UntypedVariable<K>( New ); | |
} | |
static public implicit operator K ( UntypedVariable<K> New ){ | |
return New.Value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment