Abstract
Generic types, introduced in version 2.0 of the CLR, differ from “normal” (nongeneric) types in one major aspect: “normal” types, even the abstract ones, are fully defined, while generic types represent pure abstractions—templates for the generation (or instantiation) of “normal” types. Generic types are pure abstractions because they describe types constructed not from other types but from abstract type parameters, or type variables. Thus, a generic type has one or more type parameters and hence belongs to parameterized types. You are already familiar with one generic type implemented in versions 1.0 and 1.1 of the CLR—a vector (single-dimensional, zero lower-bound array). A vector doesn’t exist per se—it’s always a vector “of something,” such as a vector of 32-bit integers, a vector of strings, or a vector of objects, and so on. The vector was (and still is) an intrinsic generic type in the sense it is implemented by the CLR but has no representation as a separate class.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2014 Serge Lidin
About this chapter
Cite this chapter
Lidin, S. (2014). Generic Types. In: .NET IL Assembler. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-6760-7_11
Download citation
DOI: https://doi.org/10.1007/978-1-4302-6760-7_11
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4302-6761-4
Online ISBN: 978-1-4302-6760-7
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)