using System; public static class Tuple { public static Tuple Create(T1 item1, T2 second) { return new Tuple(item1, second); } public static Tuple Create(T1 item1, T2 second, T3 third) { return new Tuple(item1, second, third); } public static Tuple Create(T1 item1, T2 second, T3 third, T4 fourth) { return new Tuple(item1, second, third, fourth); } public static void Unpack(this Tuple tuple, out T1 ref1, out T2 ref2) { ref1 = tuple.Item1; ref2 = tuple.Item2; } public static void Unpack(this Tuple tuple, out T1 ref1, out T2 ref2, T3 ref3) { ref1 = tuple.Item1; ref2 = tuple.Item2; ref3 = tuple.Item3; } public static void Unpack(this Tuple tuple, out T1 ref1, out T2 ref2, T3 ref3, T4 ref4) { ref1 = tuple.Item1; ref2 = tuple.Item2; ref3 = tuple.Item3; ref4 = tuple.Item4; } }