Assignment operator inheritance

前端 未结 6 1126
[愿得一人]
[愿得一人] 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:42

    You can also use "using":

    class Derived : public Base{
    public:
        using Base::operator=;
    };
    

    http://en.cppreference.com/w/cpp/language/using_declaration

    I read this post several time before someone helped me with this.

提交回复
热议问题