摘要: 昨天同事问我为什么他的类似下面的代码编译不过(VC2010):classRobbin{};classBatman{private:Robbin&assistant;};编译错误是:error C2512: 'Batman' : no appropriate default constructor available。从错误上来看很明显,编译器没有为Batman隐式生成默认构造函数。但是为什么没有生成呢?一开始没反应过来,几分钟后才想到是引用造成的。但是新的问题又来了,为什么编译错误不是error C2530: 'assistant' : referenc 阅读全文
posted @ 2011-11-26 17:49 Shawnone 阅读(1199) 评论(0) 推荐(0) 编辑