c++中增加虚类可以减少编译时间?

emmix 2008-10-17 02:03:48
请问下面这段话怎么理解:

An abstract class is purely an interface to the implemnetaions supplied as classes derived from it. This limits the amount of recompilation necessary after a change as well as the aamount of information necessary to compile an average piece of code. By decreasing the couping between a use and an implenenter, abstract classes provide an answer to people complaing about long comile times and also serve libray provides.
...全文
80 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenzhp 2008-10-17
  • 打赏
  • 举报
回复
一个抽象类纯粹就是为了给它的派生类提供接口。接口使得客户和提供者之间的分工明确,降低了再重新改变了代码后的再次编译时间。
hhyttppd 2008-10-17
  • 打赏
  • 举报
回复
这段话的大概的意思当你只修改了接口的实现,而没有改变接口本身,使用接口的客户代码不需要重新编译,从而缩短了编译时间。这应该很好理解吧?



65,211

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧