3 ms·
A container is basically a structure holding a collection. In that case, the container also acts as an allocator (the feature can be embedded directly or not)
by stephc_int13 4y ago
A container is basically a structure holding a collection.
In that case, the container also acts as an allocator (the feature can be embedded directly or not)
The only practical difference is that a container should provide some facilities for traversal, while the allocator is only taking care of allocating and freeing.
From my experience, I very rarely allocate things without keeping them in a kind of container, it can be something as simple as an array of references.