void func(vector & amp;A, vector & amp; B){A.swap(B);}
n
void func(vector & amp;A, vector & amp; B) {A.swap(B); }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!