Compare C# Generics and C++ Templates

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.

C# Generic are more flexible than C++ Templates.

C# does not allow type parameters to have default types.

Partial specialization is not supported by C# Generic.

C# generics are simpler that C++ templates.

C# Generic types are strong typed. C++ Templates are loosely typed.

C# Generic types are instantiated at the runtime. C++ templates are instantiated at the compile time.

C# Generic types do not permit the type parameters to have default values. C++ templates do.
Tags:
Hot on Web:


About author