What are the types of STL containers?

Questions by suji   answers by suji

Showing Answers 1 - 10 of 10 Answers

Valentin

  • Jul 1st, 2007
 

This is a tricky question because the answer depends very much on what a STL container definition is.

Currently there are two major types of containers defined in the C++ library: sequence containers and associative containers.
Sequence containers are: vector, deque, list,
Associative containers are: set, multiset, map and multimap.

There are 3 containers adapters: stack, queue and priority_queue.

The STL has two more data structures that some people argue they might be containers as well: bitset and valarray. There is also the specialization of the vector container for booleans, which might not be a container.

No hash containers are defined in the current C++ STL standard. However other STL implementation might have some hash based containers (ie STL SGI implementation).

The upcoming C++ standard defines, among others, in TR1 (Technical Report 1) new containers : array, unorder_set, unordered_multiset, unorder_map and unordered_multimap. Most of the TR1 is implemented in the gcc compiler. Dinkumware has a full TR1 specification implementation.

  Was this answer useful?  Yes

srinu5019

  • Mar 21st, 2011
 

Sequential containers-> vectors,Deque,list

Assosiative containers->set,multiset,map,multimap
Derived containers->stack,queue,priority queue

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions