????3.?????????????????????:
????(1) ??????????????
????a.??????????????????
????b.????????????????????????
????c.???????????????????????в????????????????????????????????????:??????
????d.????????

 

class A
{ A& operator++(){  ++m_r;++m_i;return *this;}};//??????????
A& operator(A& a)//??????????
{
++m_r;++m_i;
return a;
}

??????????????????????????
????(2) ???????????????
????a.???????????????????
????b.??????????????????????????????
????c.???????????????????????int?????????????????????????????????????????????:??????  ?? ???
????d.??????????
????class A
????{ const A operator++(int){return(m_r++??m_i++);}};//??????????
????const A operator++(A& a??int)//??????????
????{ return A(a.m_r++??a.m_i++);}
?????????const???????????????
????4. ????????????????
????4.1???:
????????????ж?????????????????????
????operator ???????(void)
????{
????????????????????????(?????????????????????????)
????}
????????:
????????????????????????????????????ú?????з?????????
???????
??????????????????????????????????????????????????ж????????????????????????????????????????????????????????????????????????????????????????????????????????(????????????????????????????explicit ????????ι???????????ù?????????????????????????????????????)
?????????
??????????????????????????????????????????????????
????Complex c(2??3);
????cout << "c + 100 " << c + 100 << endl;//c.operator+(100);
????5.???????????????????
????::???????????????
????. ????????????
????.* ???????????
?????: ????????
????sizeof  ???????????
????typeid  ?????????????
???????
????(1)?????????????????????????????????????????
????(2)??????????????????????μ???????????磺**??????????????????????????
????(2) ???????????????
????a.???????????????????
????b.??????????????????????????????
????c.???????????????????????int?????????????????????????????????????????????:??????  ?? ???
????d.??????????
????class A
????{ const A operator++(int){return(m_r++??m_i++);}};//??????????
????const A operator++(A& a??int)//??????????
????{ return A(a.m_r++??a.m_i++);}
?????????const???????????????
????4. ????????????????
????4.1???:
????????????ж?????????????????????
????operator ???????(void)
????{
????????????????????????(?????????????????????????)
????}
????????:
????????????????????????????????????ú?????з?????????
???????
??????????????????????????????????????????????????ж????????????????????????????????????????????????????????????????????????????????????????????????????????(????????????????????????????explicit ????????ι???????????ù?????????????????????????????????????)
?????????
??????????????????????????????????????????????????
????Complex c(2??3);
????cout << "c + 100 " << c + 100 << endl;//c.operator+(100);
????5.???????????????????
????::???????????????
????. ????????????
????.* ???????????
?????: ????????
????sizeof  ???????????
????typeid  ?????????????
???????
????(1)?????????????????????????????????????????
????(2)??????????????????????μ???????????磺**