What about optional generic type parameters in C# 5.0?

Posted by Lars Corneliussen on Stack Overflow See other posts from Stack Overflow or by Lars Corneliussen
Published on 2010-03-29T22:25:46Z Indexed on 2010/03/29 22:43 UTC
Read the original article Hit count: 349

Filed under:
|
|

Just a thought.

Wouldn't it be useful to have optional type parameters in C#?

This would make life simpler. I'm tired of having multiple classes with the same name, but different type parameters. Also VS doesn't support this very vell (file names) :-)

This would eliminate the need for a non-generic IEnumerable:

interface IEnumerable<out T=object>{
  IEnumerator<T> GetEnumerator()
}

What do you think?

© Stack Overflow or respective owner

Related posts about c#

Related posts about c#5.0