myswap函数本来是指针形参,改成引用后又异常。求高手解答

myswap函数本来是指针形参,改成引用后又错误。求高手解答!
#include<iostream>
using namespace std;
void myswap(int& x, int& y);
int main()
{
int a=16,b=48;
int& ra=a;
int& rb=b;
cout<<"a="<<a<<", b="<<b<<endl;
myswap(&ra,&rb);
cout<<"After Being Swapped:\n";
cout<<"a="<<a<<", b="<<b<<endl;
return 0;
}
void myswap(int& x, int& y)
{
int temp=&x;
&x=&y;
&y=temp;

}


------解决方案--------------------
C/C++ code

#include<iostream>
using namespace std;
void myswap(int& x, int& y);
int main()
{
    int a=16,b=48;
    /*int& ra=a;
    int& rb=b;*/
    cout<<"a="<<a<<", b="<<b<<endl;
    myswap(a,b);
    cout<<"After Being Swapped:\n";
    cout<<"a="<<a<<", b="<<b<<endl;
    return 0;
}
void myswap(int& x, int& y)
{
    int temp=x;
    x=y;
    y=temp;

}

------解决方案--------------------
C/C++ code

&x=&y; //compile error
&y=temp;