harttle / harttle.github.io

Harttle Land 的源码和文章
https://harttle.land
Creative Commons Attribution 4.0 International
122 stars 32 forks source link

2015/08/29/effective-cpp-31 #167

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Effective C++ 31:最小化文件之间的编译依赖 | Harttle Land

最小化编译依赖的一般做法是依赖于声明而非定义,这个想法可以通过句柄类或接口类来实现。库的声明应当包括“完整的”和“只有声明的”两种形式。

https://harttle.land/2015/08/29/effective-cpp-31.html

suyunzzz commented 1 year ago

你好,有个问题请教一下:接口类这种方法Person解除了和Date的编译依赖关系,但是RealPerson仍然需要和Date的编译依赖啊?