vector swap() in C++
In C++, std::vector::swap() is a built-in function used to exchange the contents to two vectors of same type. This function does not copy, move or swap the individual elements, instead, it swaps the internal pointers to the dynamically allocated array of both vectors and updates the size accordingly