• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
sfesly
博客园 首页 新随笔 联系 订阅 订阅 管理

2016年1月5日

c++ covariant return type
摘要: ... 阅读全文
posted @ 2016-01-05 15:55 sfesly 阅读(332) 评论(0) 推荐(0)
 
为什么需要虚析构函数?
摘要: When should my destructor be virtual?When someone will delete a derived-class object via a base-class pointer.In particular, here’s when you need to m... 阅读全文
posted @ 2016-01-05 14:16 sfesly 阅读(629) 评论(0) 推荐(0)
 
继承是为了被复用,而不是复用
摘要: 一般在一个框架库里面,我们继承一个库里已有的类,但是又不想把它周边的一套完全重整,所以希望我们定义的这个类能像类库里那个类一样到处能用,这时候只要我们保证把类库里原有的public接口全部完整实现(或者直接用基类的),就可以做到这一点。在有友元存在的情况下,记住友元也是类的一部分,要连带一起定义新的... 阅读全文
posted @ 2016-01-05 11:22 sfesly 阅读(332) 评论(0) 推荐(1)
 
How can I protect derived classes from breaking when I change the internal parts of the base class?
摘要: How can I protect derived classes from breaking when I change the internal parts of the base class?A class has two distinct interfaces for two distinc... 阅读全文
posted @ 2016-01-05 11:14 sfesly 阅读(178) 评论(0) 推荐(0)
 
 

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3