stl swap函数
C ++ STL vector :: swap()函数 (C++ STL vector::swap() function)
vector::swap() function is used to swap/exchange the content of two vectors with the same type, their sizes may differ.
vector :: swap()函数用于交换/交换相同类型的两个向量的内容,它们的大小可能不同。
The contents of vector1 are exchanged with the content of vector2. Vectors must be of the same type i.e. either both of them are of type int, string, long, etc.
vector1的内容与vector2的内容交换。 向量必须具有相同的类型,即两个向量均为int,string,long等类型。
This is not necessary that both of the vectors must have the same size i.e. size of both the vectors may differ from each other.
两个矢量必须具有相同的大小是不必要的,即,两个矢量的大小可以彼此不同。
Note: Both the