![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C# Generics vs C++ Templates
C# Generics and C++ Templates provide support for parameterized types. The following are the differences −
Flexibility
C++ Templates are more flexible than C# Generics
Explicit specialization
Explicit specialization is not supported by C#
Type Parameter
The type parameter cannot be used as the base class for the generic type in C#
C# does not allow type parameters to have default types.
Run-Time
The C++ template has a compile-time modal, whereas C# Generics is both compile and run-time. Generics have run-time support.
Non-type template parameters
C#Templates will not allow non-type template parameters.
Partial Specialization
C# does not even support partial specialization.
Advertisements