why there is no specialized generics?

V

Valery

Why there are no specializations of generics in C# similar to those in
C++? Is there a fundamental reason for that? If there is no, can we
expect to have it ... eventually?

We write performance critical software in C# and it is very often
required to have kind of specialization for several types. Typically
we do not need a general case at all. The above mentioned ommission is
the most important language improvement we need.

Valery
 
N

Nicholas Paldino [.NET/C# MVP]

I doubt this is going to make it into the language/framework anytime
soon.

However, you can more than likely get around this with the proper design
of your types and virtual/abstract methods/properties. Either that, or have
a general interface definition (non-Generic) if you need to enforce some
sort of polymorphism.

If you really think that it's something that should be in the language,
then I recommend that you go to the Microsoft Connect site and input a
recommendation, or vote on a current one (if it exists) and then get support
for it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top