Created
June 1, 2012 01:16
-
-
Save ChrisMissal/2847833 to your computer and use it in GitHub Desktop.
Not sure what this is called, anonymous tuple?
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
// I want to be able to do this in C# | |
int a = 4; | |
int b = 2; | |
(a, b) = (b, a); // swap values | |
// ... and used in some terribly named methods... | |
public void AssignValues() | |
{ | |
var (id, name) = GetValues(); | |
// more statements | |
} | |
public int, string GetValues() | |
{ | |
return (123, "gist"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment