Skip to content

Instantly share code, notes, and snippets.

@Const-me
Created September 11, 2019 13:11
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 Const-me/63d11f7872cb92c61651a7d6087ba7c3 to your computer and use it in GitHub Desktop.
Save Const-me/63d11f7872cb92c61651a7d6087ba7c3 to your computer and use it in GitHub Desktop.
static class Utils
{
/// <summary>Append a new item to list, return that item</summary>
public static E appendNew<E>( List<E> list ) where E : new()
{
E newVal = new E();
list.Add( newVal );
return newVal;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment