Skip to content

Instantly share code, notes, and snippets.

@daneb
Created July 19, 2019 09:41
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/9ab19f0a644a3e79525f932e4e34cd5f to your computer and use it in GitHub Desktop.
Save daneb/9ab19f0a644a3e79525f932e4e34cd5f to your computer and use it in GitHub Desktop.
Generic Swap
// Generic
public void Swap<T>(ref T lhs, ref T rhs)
{
T temp;
temp = lhs;
lhs = rhs;
rhs = temp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment