Skip to content

Instantly share code, notes, and snippets.

@dirvo dirvo/CrazyType.cs Secret
Last active Feb 7, 2018

Embed
What would you like to do?
using System;
class CrazyType
{
private int _value;
public static implicit operator CrazyType(int value)
{
return new CrazyType { _value = value };
}
public static implicit operator int(CrazyType value)
{
return value._value++;
}
private static void Main(string[] args)
{
CrazyType a = 1;
if (a == 1 && a == 2 && a == 3)
{
Console.WriteLine("YAY!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.