O'Reilly logo

C++ Primer Plus, Fourth Edition by Stephen Prata

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Additional Members for Vectors, Lists, and Deques

Vectors, lists, and deques are all sequences, and they all have the methods listed in Table G.3. Again, X is a container type, such as vector<int>, and T is the type stored in the container, such as int, a is a value of type X, t is a value of type X::value_type, i and j are input iterators, q2 and p are iterators, q and q1 are dereferenceable iterators (you can apply the * operator to them), and n is an integer of X::size_type.

Table G.3. Methods Defined for Vectors, Lists, and Deques
Method Description
a.insert(p,t) Inserts a copy of t before p; returns an iterator pointing to the inserted copy of t. The default value for t is T(), that is, the value used for type T in the absence of explicit ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required