There are three types of adapters in C + +: Container adapter, iterator adapter, and function adapter. Here are the following:
1. Container adapter: Because these containers are implemented based on other standard containers, which are called container adapters, specifically stack,queue,priority_queue, stack and queue are implemented based on deque, by default, Priority_queue is implemented on a vector, you can specify the type of container according to the second argument, but be sure to conform to the standard, and queue requires push_front operation and therefore cannot be built on the vector, priority_ Front requires random access and is therefore built on top of the vector. The priority queue is a large top heap by default, which is high priority, which can be customized after the precedence comparison rule
2. Iterator adapter: includes three kinds of reverse (reverse) adapters, insert (placement-type) iterators, stream (stream) adapters. Reverse adapter: such as Rbegin (), rend (), etc.
Insert iterator: is an iterator adapter with a container parameter and generates an iterator that provides three types of back_inserter (container), Front_inserter (Container), Inserter (container, position).
Stream adapter: such as Ostream_iterator,istream_iterator.
3. Function Adapter , used to extend unary and two function objects, such as functor function pair image and so on. Used for operations before the container and the algorithm.
Preliminary understanding of STL adapters