// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { public struct FunnyInt { private int v; public FunnyInt(int v) { this.v = v; } public override string ToString() { return v.ToString(); } public static implicit operator int(FunnyInt fi) { return fi.v; } } public class MainClass { public static void Main(string[] args) { FunnyInt a = new FunnyInt(); Console.WriteLine(a); FunnyInt b = new FunnyInt(0); Console.WriteLine(b); Console.WriteLine(b + 1); } } }