g++ “because the following virtual functions are pure” with abstract base class
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here is my example code which produces the error: struct Impl { int data_size_; int find(int var){return 0;} int get(int rowid){return 0;} }; class Container { public: Container() {} virtual ~Container() {} virtual int get_size() = 0; virtual int get(int rowid) = 0; }; class SortedContainer : virtual public Container { public: virtual int find(int var) = 0; }; class ContainerImpl : public Container { protected: Impl impl_; public: int get_size() {return impl_.data_size_;} int get(int rowid) {return impl_.get(rowid);} }; class