Skip to content

Instantly share code, notes, and snippets.

@Echooff3
Created April 24, 2015 16:50
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 Echooff3/60d44fb3774a2a4375af to your computer and use it in GitHub Desktop.
Save Echooff3/60d44fb3774a2a4375af to your computer and use it in GitHub Desktop.
C# Tuple List
//Found this on stack. Credit to the guy that wrote it!
public class TupleList<T1, T2> : List<Tuple<T1, T2>>
{
public void Add( T1 item, T2 item2 )
{
Add( new Tuple<T1, T2>( item, item2 ) );
}
}
/*
var groceryList = new TupleList<int, string>
{
{ 1, "kiwi" },
{ 5, "apples" },
{ 3, "potatoes" },
{ 1, "tomato" }
};
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment