Skip to main content

Generic Types

  • Chapter
  • First Online:
.NET IL Assembler
  • 961 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics