How to swap 2 objects using template function ??? I just want to swap the age number between 2 objects from same class using template function called my_swap().
struct Men
{
    std::string name;
    int age;
}
std::ostream &operator<<(std::ostream &os,const Men &M)
{
    os << M.name;
    return os;
}
template <typename T>
void my_swap(T &a,T &b)
{
    T temp = a;
    a = b;
    b= temp;
}
int main()
{
    int x{100};
    int y{200};
    my_swap(x,y);
    std::cout << x << "," << y << std::endl;
}
What I want to do is:
Men M1{"Jack", 10};
Men M2{"Tony", 20};
Men M3 = my_swap(M1, M2);
 
     
    