Differences Between C++ Templates and C# Generics (C#)
Full Name:
Differences Between C++ Templates and C# Generics (C#)
Short Name:
Differences Between C++ Templates and C# Generics (C#)
Type of Entity:
C#
Abstract:
C# Generics and C++ templates are both language features that provide support for parameterized types. However, there are many differences between the two. At the syntax level, C# generics are a simpler approach to parameterized types without the complexity of C++ templates. In addition, C# does not attempt to provide all of the functionality that C++ templates provide. At the implementation level, the primary difference is that C# generic type substitutions are performed at runtime and generic type information is thereby preserved for instantiated objects. For more information, see Generics in the Runtime (C# Programming Guide).
MSDN Source URL:
http://msdn2.microsoft.com/c6cyy67b.aspx