Skip to content

Instantly share code, notes, and snippets.

@Const-me Const-me/generic.cs
Created Sep 11, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.