Built-in types such as int, double, and pointers map closely to machine capabilities. User-defined types let a program represent concepts directly, group related data, and protect the rules that keep that data valid. This chapter introduces structures, classes, enumerations, and unions, and shows why standard-library types such as std::vector and std::variant are usually preferable to hand-managed storage.
User-Defined Types
From machine-level values to domain-level abstractions