Does C# have templates like C++?

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]