IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    [原]object of abstract class type "我的类" is not allowed 解决方案

    lincyang发表于 2011-04-30 10:38:00
    love 0

    想把派生类做成单例,

    public: static 我的类* getInstance() {   
    if( _uniqueInstance == 0 ) {   
    _uniqueInstance = new 我的类(); //这里报错
    }   
    return _uniqueInstance;   
    }   

     

    报错为:object of abstract class type "我的类" is not allowed

     

    原来是父类里的虚函数子类没有实现造成的。

     

    汗!~~



沪ICP备19023445号-2号
友情链接