using System.Diagnostics;
Int x = 10;
Int y = 20;
Int.Swap(x, y);
Debug.Assert(x == 20);
Debug.Assert(y == 10);
public class Int
{
private int _value;
public static void Swap(Int x, Int y)
var tmp = x._value;
x._value = y._value;
y._value = tmp;
}
public static implicit operator Int (int value)
return new Int { _value = value };
public static implicit operator int(Int value)
return value._value;