Skip to content

Instantly share code, notes, and snippets.

@JamesxX
Created September 12, 2017 10:30
Show Gist options
  • Save JamesxX/ec3cfd97e12195e2d94f7f9894353993 to your computer and use it in GitHub Desktop.
Save JamesxX/ec3cfd97e12195e2d94f7f9894353993 to your computer and use it in GitHub Desktop.
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