Skip to content

Instantly share code, notes, and snippets.

@daneb
Last active July 19, 2019 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daneb/f318890ecb9849ced43bccfe86744093 to your computer and use it in GitHub Desktop.
Save daneb/f318890ecb9849ced43bccfe86744093 to your computer and use it in GitHub Desktop.
Calling Swap
int a = 1;
int b = 2;
string aa = "Hello";
string bb = "World";
Swap<int>(ref a, ref b);
Swap(ref a, ref b); // we can even ignore being explicit about the type.
Swap(ref aa, ref bb);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment