liveBook · Manning

Push_back

push_back is an operation that appends an element to the end of a sequence container or returns a sequence containing the appended element.

How 2 Manning books explain it

Object-Oriented Software Design in C++

A standard C++ vector operation that appends an element to the container's end.

How it is used
Uses push_back() to append appointments while exposing the performance cost of hidden vector operations.
How deep it goes
Explains copying, allocation, relocation, and destruction during growth, but does not develop broader vector-performance techniques.
Examples
Demonstrates append operations with Date objects and reports constructor and destructor calls through instrumentation.
What you can do after
Diagnose unexpected copying, allocation, and destruction when appending objects to a vector.

Read how Object-Oriented Software Design in C++ explains push_back →

Learn C++ by Example

push_back is a C++ sequence-container member function that appends an element to the container.

How it is used
Appends calculated or existing objects to the end of sequence containers such as std::vector.
How deep it goes
Explains copying, rvalue overloads, moving temporaries, and the contrast with emplace_back; it defers complete value-category details.
Examples
Uses Pascal’s triangle rows, triangle.push_back(data), and push_back(get_next_row(triangle.back())) to demonstrate copying and moving.
What you can do after
Apply it via std::vector to append existing objects and recognize when an lvalue is copied or a temporary is moved.

Read how Learn C++ by Example explains push_back →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.