June 2025
Intermediate to advanced
1093 pages
33h 24m
English
In this section, I refer to Chapter 24. That means you will see the ubiquitous vector, the sorted set, and the mapping map. However, this generally applies to all containers. If you are not yet familiar with them, you should initially skip this section. But as soon as you want to make your own classes fit to be packed into containers, you should study this section.
You can put (almost) all your own classes into a vector. There are only a few conditions tied to the data type in the container: your class should be able to be created with the default constructor (without arguments), and you must be able to copy and assign it.
// https://godbolt.org/z/8ejPs6zr6#include <vector>struct Number { int value_ ...
Read now
Unlock full access