Does C# have templates like C++?

Does C# have templates like C++?

  • Comments 2

Although C# doesn't have templates, and isn't likely to get them, it is getting a feature called generics which will be available in the next version of .NET and Visual Studio. Generics will be a feature in the CLR itself, and most languages targetting the CLR will change to support it. Generics provide a lot of the functionality of C++ templates (mostly in terms of type safety) but in a more restricted (and therefore potentially less confusing) way.

For more information, see:

[Author: Jon Skeet]

Leave a Comment
  • Please add 2 and 7 and type the answer here:
  • Post
  • Too bad we have to wait until the first half of 2005 to get these features...
  • Yep, Micrsofties, quit living in your dream world where your delayed future products exist and focus on what we have to use and live with.
Page 1 of 1 (2 items)