Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on What is the most intrusive wart on your favourite programming language?. Parent comment
public T AssignLiteItem<T>(ArchivingItem archivingItem ) where T : Item, new() {
T myITem = new T();
myITem.ItemReference = new ItemReference(archivingItem.Id);
return myITem;
}
I do wish the compiler handled constraints for arbitrary constructor signatures on generic types, however...
public T AssignLiteItem<T>(ArchivingItem archivingItem ) where T : Item, new() {
T myITem = new T();
myITem.ItemReference = new ItemReference(archivingItem.Id);
return myITem;
}
I do wish the compiler handled constraints for arbitrary constructor signatures on generic types, however...