在《C++箴言:确保公开继续模拟“is-a”》一文中论述了 C++ 将 public inheritance(公有继续)视为一个 is-a 关系。
作者: fatalerror99 出处:BLOG 在《C++箴言:确保公开继承模拟“
触及 multiple inheritance (MI)(多继续)的时候,C++ 社区就会鲜明地分裂为两个基本的阵营。一个阵营认为假如 single inheritance (SI)(单继续)是有
template metaprogramming (TMP)(模板元编程)是写 template-based(基于模板)的运行于编译期间的 C++ 程序的过程。考虑一下:一个 template m
在 Some Must Watch While Some Must Sleep (W. H. Freeman and Company, 1974) 这本书中,William Dement 讲述了一
莎士比亚有一个关于名字的说法。"What’s in a name?" 他问道,"A rose by any other name would smell as sweet."(语出《罗密欧与朱丽叶
(public) inheritance 这个表面上简单易懂的观念,一旦被近距离审阅,就会被证实是由两个相互独立的部分组成的:inheritance of function interfaces(
在上一篇文章中介绍了作为资源治理类支柱的 Resource Acquisition Is Initialization (RAII) 原则,并描述了 auto_ptr 和 tr1::shared_
假设我们和一个投资(例如,股票,债券等)模型库一起工作,各种各样的投资形式从一个根类 Investment 派生出来: class Investment { ... }; // root cla
在程序中,难免要访问某个对象的私有成员。那么以前实现这类功能的方法有两种,第一种方法最简单,就是把成员访问符从“private”改为“public”即可;而另一个就是提供公有的成员访问函数来进行访