Wednesday, May 9, 2012

operations on deque

Below  from Table 1 through Table 3 list all operations provided for deques


Table 1 Constructors and Destructor of Deques


Table 2 Nonmodifying Operations of Deques


Table 3 Modifying Operations of Deques



Deque operations differ from vector operations only as follows:
  1. Deques do not provide the functions for capacity (capacity () and reserve ()).
  2. Deques do provide direct functions to insert and to delete the first element (push_front() and pop_front()).

Because the other operations are the same, they are not reexplained here. 

Note that you still must consider the following:
  1. No member functions for element access (except at ()) check whether an index or an iterator isvalid.
  2. An insertion or deletion of elements might cause a reallocation. Thus, any insertion or deletioninvalidates all pointers, references, and iterators that refer to other elements of the deque. Theexception is when elements are inserted at the front or the back. In this case, references andpointers to elements stay valid (but iterators don't).


See Also:

No comments:

Post a Comment