Monday, August 16, 2010

Vector Reallocations

When a vector is forced to perform a reallocation, all of its elements must to be copied. For a deque (pronounced "deck"), it is not always necessary that all of its elements are copied during a reallocation. This is because a deque does not have to be stored contiguously as in the case of a vector.

Reference: The C++ Standard Library by Nicolai M. Josuttis. Addison-Wesley, 1999, p. 161.

No comments:

Post a Comment