Generics (C++)
Visual C++ 2005 introduces support for generic methods and types in C++. In this section, find out how to author your own generic methods and types in C++ and how to use generic types authored in C# or another language in C++. This section also includes a comparison of generics and C++ templates.
In This Section
- Overview of Generics in C++
Information about generics are, the motivation for the language feature, definitions of terms used to describe generics, and information about the use of reference types and value types as type parameters for generics.
- Generic Functions
Information about defining and using generic functions and methods.
- Generic Classes (C++)
Information about defining and using generic classes.
- Generic Interfaces (C++)
Information about defining and using generic interfaces.
- Generic Delegates (C++)
Information about defining and using generic delegates.
- Constraints
Information about using constraints in generic types.
- Consuming Generics from Other .NET Languages
Information about using generics defined in .NET assemblies, possibly authored in other languages, in C++.
- Generics and Templates
A comparison of generics and templates, when to use each, and how to combine them usefully.
Related Sections
- How to: Iterate Over a Generic Collection with for each
Using the for each, in keyword on a generic collection.
- Generics in the .NET Framework Class Library (C# Programming Guide)
Discusses .NET Framework class library's System.Collections.Generic, namespace, which includes several ready-to-use generic collection classes and associated interfaces.
- Introduction to Generics (C# Programming Guide)
The generics section in the C# documentation.
- Generics in J#
The generics section in the J# documentation.
- Generic Types in Visual Basic
The generics section in the Visual Basic documentation.
- Templates Overview
Information on templates in C++.