Deleting copy constructor breaks inherited constructors

后端 未结 3 1589
有刺的猬
有刺的猬 2021-02-19 19:41

I am trying to use the constructor inheritance feature of C++11. The following snippet (copied from somewhere, I don\'t remember whence) works completely fine:

#         


        
3条回答
  •  粉色の甜心
    2021-02-19 19:58

    Whenever you define a custom constructor you need to provide a default constructor explicitly. I.e.

    Derived::Derived() = default;
    

提交回复
热议问题