I define on main 2 variables m,n from new class S. Then, I want to swap them with the template function swap.. The question is: what are the methods that S use to run this code and how it look like? :
template <class T>
void swap(T &a ,T &b)
{
T tmp= a;
a=b;
b=tmp;
}
template <class T>
class S{
public:
S:();
S:(const S& data);
~S();
S &operator=(const S&g);
};
int main(){
S m,n;
swap(m,n);
cout<< "m is "<<m<< "n is "<<n<<endl;
return 0;
}