Because if you switch from std::vector to std::list or other container, it may be different.
For example some implementations of std::list::size take O(n) and not O(1).
Because if you switch from std::vector to std::list or other container, it may be different.
For example some implementations of std::list::size take O(n) and not O(1).