Chapter 4. Procedural Lifetime

The D programming language contains value types, pointer types, and reference types. Each type has unique storage attributes and manifests a different functional lifetime. Additionally, type attributes can affect the lifetime of the associated declaration, occasionally in rather unique ways. The aim of this chapter is to explore the lifetime guarantees afforded to each kind of type and to elucidate some of the more specialized language behavior related to the lifetime of reference types.

D Language Type Classifications

Before diving into the particulars of specific data types, it may be useful to review how types are classified. D language types fall into three main categories:

Value: A value type is a type whose data ...

Get Learn to Tango with D now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.