
std::vector::push_back()
Appends the given element value to the end of the container.
- The new element is initialized as a copy of value.
- value is moved into the new element.
If the new size() is greater than capacity() then all iterators and references (including the past-the-end iterator) are invalidated. Otherwise only the past-the-end iterator is invalidated. (Cite from: cppreference.com)
Example
Firstly, if we have a class String, then we can use this class to test the push_back() functions.
1 |
|




近期评论