Created
May 1, 2012 09:32
-
-
Save cryks/2566761 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Values { | |
public static void Receive<T1, T2>(this Tuple<T1, T2> tuple, out T1 item1, out T2 item2) { | |
item1 = tuple.Item1; | |
item2 = tuple.Item2; | |
} | |
public static void CallWith<T1, T2>(this Tuple<T1, T2> tuple, Action<T1, T2> func) { | |
func(tuple.Item1, tuple.Item2); | |
} | |
} | |
int a, b; | |
Tuple.Create(1, 2).Receive(out a, out b); | |
Tuple.Create(3, 4).CallWith((c, d) => Console.WriteLine(c + d)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment