Vector operations - summary

Operation Meaning
V.empty() Returns true, if V has no elements. Otherwise, it returns false.
std::ssize(V) Returns the number of elements in V, i.e. $0$ or more.
V.push_back(e) Adds an element with value e to the end of V.
V.pop_back() Removes the last element of V. Calling pop_back on an empty vector results in undefined behavior.
V.clear() Removes all elements from V, i.e. std::ssize(V) becomes $0$.
V[i] Returns the element with subscript $i$, i.e. the $(i+1)$th element stored in the vector.
V1 = V2 Replaces the elements in vector V1 with a copy of the elements in vector V2.
V1 == V2 Returns true, if std::ssize(V1) is equal to std::ssize(V2) and V1[0] == V2[0], V1[1] == V2[1], $\cdots$, V1[std::ssize(V1)-1] == V2[std::ssize(V2)-1]. Otherwise, it returns false.
V1 != V2 Returns true, if V1 == V2 returns false. Otherwise, it returns false.

Finally, it’s important to remember that the first element of a vector has subscript zero (i.e. V[0]), while the last element of the vector has subscript std::ssize(V)-1 (i.e. V[std::ssize(V)-1]).