Containers library
From Cppreference
C++ Standard Library | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Containers library | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The Containers library is a generic collection of class templates and algorithms that allow programmers to easily implement standard data structures like queues, lists and stacks.
Three kinds of containers are provided:
- Sequence Containers
- array (C++11 feature)
- vector
- deque
- forward_list (C++11 feature)
- list
- Associative Containers
- Unordered Associative Containers
- unordered_set (C++11 feature)
- unordered_multiset (C++11 feature)
- unordered_map (C++11 feature)
- unordered_multimap (C++11 feature)
In addition, the several container adaptors are provided.
They can be considered containers, but don't meet all the requirements of them.
- Container Adapters
The idea behind the C++ containers library is that the hard part of using complex data structures has already been completed. If a programmer would like to use a stack of integers, all one has to do is use this code:
std::stack<int> my_stack;
With minimal effort, one can now push and pop integers onto this stack. Because std::stack is a class template, one could specify any data type, not just integers. The std::stack class will provide generic functionality of a stack, regardless of the data in the stack.
[edit] Member function table
- features present in C++03 |
- features present only in C++11 |