All C++ Containers
All C++ Containers
A compact scan page listing the main standard C++ containers, adapters, and contiguous views.
All C++ Containers
A compact scan page listing the main standard C++ containers, adapters, and contiguous views.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
This page is optimized for scanning. Use C++ containers and views when you want a fuller explanation.
std::arraystd::vectorstd::dequestd::liststd::forward_liststd::mapstd::multimapstd::setstd::multisetstd::unordered_mapstd::unordered_multimapstd::unordered_setstd::unordered_multisetstd::stackstd::queuestd::priority_queuestd::spanstd::mdspan#include <map>
#include <string>
int main() {
std::map<std::string, int> counts{std::pair{"Ada", 1}, std::pair{"Bjarne", 2}};
auto [it, inserted] = counts.insert({"Grace", 3});
return inserted ? it->second : 1;
}