Re:Span<T> in C#
by zzbzq on Sunday November 19, 2017 @11:27AM
(#15734491)
Not sure what you mean by "delegates can't accept generic type parameters" because you can certainly make a delegate with a <T> in it in C#
[ Parent
| on HN ]
There is no delegate equivalent of passing around an instance of IFoo:
interface IFoo
{
void Bar<T>();
}
This is known as first-class polymorphism.Classes with methods are strictly more powerful than delegates, but they shouldn't be. It's even worse than that actually, because you can't even create an open instance delegate to a generic interface or abstract class method (you'll get a runtime error, not even a static error).