Chapter 10. Generics and Containers
This chapter covers more deeply the subject of generics. Generics are classes and functions that can operate just as easily on objects as primitive types. Qt container classes are generic, template-based classes, and we will see examples using lists, sets, and maps. Operators, managed containers, and resource sharing are also discussed.
Generics and Templates | ||
Containers | ||
Managed Containers, Composites, and Aggregates | ||
Implicitly Shared Classes | ||
Generics, Algorithms, and Operators | ||
Serializer Pattern | ||
Sorted Map Example |
Generics and Templates
C++ supports four distinct categories of types:
Primitives:
int
,char
,float
,double
, etc.Pointers
Instances of
class/struct
Arrays
Because ...
Get An Introduction to Design Patterns in C++ with Qt 4 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.