Assignment operator inheritance

前端 未结 6 1111
[愿得一人]
[愿得一人] 2020-11-29 04:09

There is this code:

#include 

class Base {
public:
    Base(){
        std::cout << \"Constructor base\" << std::endl;
    }
            


        
6条回答
  •  旧巷少年郎
    2020-11-29 04:46

    That is because the default assignment operator created calls it's base assignment operator, i.e. it isn't inherited but still called as part of the default assignment operator.

提交回复
热议问题