behaviour of the implicit copy constructor / assignment operator

后端 未结 2 1661
广开言路
广开言路 2021-01-22 03:15

I have a question regarding the C++ Standard.

Suppose you have a base class with user defined copy constructor and assignment operator. The derived class uses the implic

2条回答
  •  忘掉有多难
    2021-01-22 03:48

    Only if the derived class has an explicitly defined operator function. Otherwise, the op function of the parent class is called. Otherwise, the implicit C++ one is called.

提交回复
热议问题