Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Defining your own data

Use classes for records with fields and methods, and enums for alternatives. Their fields follow the same ownership and cleanup rules as collections.

Heterogeneous collections combines classes and enums in lists and dictionary values, and explains the restrictions on sets and dictionary keys. Special-purpose data structures introduces columnar lists for scanning selected primitive fields.