calling operators of base class… safe?

后端 未结 3 963
野趣味
野趣味 2020-12-29 02:38

Is following pattern ok/safe ? Or are there any shortcomings ? (I also use it for equality operators)

Derived& operator=(const Derived& rhs)
{
    st         


        
3条回答
  •  星月不相逢
    2020-12-29 03:22

    Yes, it's safe.

    A different syntax to do the same thing could be:

    Base::operator=( rhs );
    

提交回复
热议问题