// This function should work on almost any data type
template <typename value_type>
void swap( value_type& value1, value_type& value2 )
{
value_type temp = value1;
value1 = value2;
value2 = temp;
}
Pls don't blindly copy it, do you understand the code?