14
The article at cppreference.com tells that the complexity of std::vector::shrink_to_fit is constant. As far as I know that is only possible if the elements are not moved, because if they are then the complexity is n. It also says that All iterators, including the past the end iterator, are potentially invalidated. which means that the moving of elements is a well defined possibility.
Is the article faulty? ... or is there any magic that I don't know about?