Skip to content

Instantly share code, notes, and snippets.

@Steinblock
Created November 2, 2015 13:29
Show Gist options
  • Save Steinblock/10df18afb948866be1ba to your computer and use it in GitHub Desktop.
Save Steinblock/10df18afb948866be1ba to your computer and use it in GitHub Desktop.
Answer
public enum Answers
{
No,
Yes,
}
public struct Answer
{
public Answer(Answers answer)
{
this.Value = answer;
}
public readonly Answers Value;
public static bool operator !(Answer x)
{
return !(x.Value == Answers.Yes);
}
public override string ToString()
{
if (!this)
return "No";
else
return "Yes";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment