· Alan Talbot

Host: Robert Douglas
RSVP on Meetup via: Chicago C/C++ Users Group

Choosing the right container and using it correctly can have a profound impact on the performance of a program, but what may appear to be the obvious choice can turn out to be the wrong one. In this two-part series, we will survey the containers and adaptors in the C++26 Standard Library and discuss how to choose the right tool for the job and extract the best performance from it.

We will explore the abstractions each container models and the practical limitations it imposes. We will see that choosing between them requires an understanding not only of the speed and size tradeoffs of each container, but also of the difference between algorithmic complexity and actual behavior. Along the way, we will investigate aspects of the original (C++98) STL container design principles that can often lead to the wrong choice.

In the first session we will look at the block-based contiguous sequence containers (vector and inplace_vector), the block-based semi-contiguous sequence container (deque), and the node-based (non-contiguous) sequence containers (list and forward_list). We will also discuss the sequence container adaptors.

Updated: