1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
public class D { byte v; byte this [int idx] { get { return v; } set { v = value; } } public static int Main () { D d = new D (); byte b = 1; d [0] += 1; d [0] += b; if (d [0] != 2) return 1; return 0; } }