Home > Backend Development > C#.Net Tutorial > C# Generics and C++ Templates

C# Generics and C++ Templates

WBOY
Release: 2023-08-27 13:37:10
forward
1069 people have browsed it

C# 泛型与 C++ 模板

#C# Generics and C templates provide support for parameterized types. Here are the differences -

Flexibility

C templates are more flexible than C# generics

Explicit specialization

Explicit specialization is not supported by C

#Type parameters

Type parameters cannot be used as base classes for generic types in C

#C# does not allow type parameters to have default values

Runtime

C templates have compile-time mode, while C# generics are both compile-time and run-time. Generics have runtime support.

Non-type template parameters

C#Templates does not allow non-type template parameters.

Partial Specialization

C# doesn't even support partial specialization.

The above is the detailed content of C# Generics and C++ Templates. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template