using namespace std;
struct A
{
const A& operator *() const;
A& operator *();
};
//-----------------------------------
const A& A::operator *() const
{
cout<<"first"<<endl;
return *this;
}
//-----------------------------------
A& A::operator *()
{
cout<<"second"<<endl;
return *this;
}
//-----------------------------------
int main()
{
A a,b;
*a = b;
b = *a;
return 0;
}
//---------------------------------------------------------------------------