I have the following C# test code:
class MyItem { MyItem( int a ) {} } class MyContainer< T > where T : MyItem, new() { public void
There's no such generic constraint, so it's not possible directly (this is a CLR limitation). If you want this, you have to provide a factory class (which has a parameterless constructor), and pass it as a second generic type parameter.