http://www.cplusplus.com/reference/stl/
- Reference
- Containers
Not logged in
library
Containers
Standard Containers
A container is a holder object that stores a collection of other objects (its elements). They are implemented as class templates, which allows a great flexibility in the types supported as elements.The container manages the storage space for its elements and provides member functions to access them, either directly or through iterators (reference objects with similar properties to pointers).
Containers replicate structures very commonly used in programming: dynamic arrays (vector), queues (queue), stacks (stack), heaps (priority_queue), linked lists (list), trees (set), associative arrays (map)...
Many containers have several member functions in common, and share functionalities. The decision of which type of container to use for a specific need does not generally depend only on the functionality offered by the container, but also on the efficiency of some of its members (complexity). This is especially true for sequence containers, which offer different trade-offs in complexity between inserting/removing elements and accessing them.
stack, queue and priority_queue are implemented as container adaptors. Container adaptors are not full container classes, but classes that provide a specific interface relying on an object of one of the container classes (such asdeque or list) to handle the elements. The underlying container is encapsulated in such a way that its elements are accessed by the members of the container class independently of the underlying container class used.
Container class templates
Sequence containers:- vector
- Vector (class template )
- deque
- Double ended queue (class template )
- list
- List (class template )
Container adaptors:
- stack
- LIFO stack (class template )
- queue
- FIFO queue (class template )
- priority_queue
- Priority queue (class template )
Associative containers:
- set
- Set (class template )
- multiset
- Multiple-key set (class template )
- map
- Map (class template )
- multimap
- Multiple-key map (class template )
- bitset
- Bitset (class template)
Member map
This is a comparison chart with the different member functions present on each of the different containers:Legend:
C++98 | Available since C++98 |
---|---|
C++11 | New in C++11 |
Sequence containers
Associative containers
반응형
'프로그래밍(Programming) > c++, 11, 14 , 17, 20' 카테고리의 다른 글
POD(S) - Plain Old Data Structures (0) | 2013.05.19 |
---|---|
ANSI ,와이드, 멀티바이트 문자 셋용 함수 (0) | 2013.05.14 |
커스텀 메모리 할당자 (Are we out of memory?) (0) | 2013.05.11 |
sqrt를 사용하지 않는 방법이있다면 피하자 (0) | 2013.05.08 |
템플릿(template)을 이용한 에러객체 만들기 (0) | 2013.05.08 |