2018年6月17日

Managing C++ Objects: 管理C++对象 —— 一些建议准则

摘要: 原文链接: Managing C++ Objects Here are some guidelines I have found useful for writing C++ classes. There are many good books on the subject, but they ha 阅读全文

posted @ 2018-06-17 19:32 王家恒 阅读(137) 评论(0) 推荐(0) 编辑

像Java一样管理对象:T&形式仅仅用在参数传递

摘要: 类的对象为了关联/包含一个T类型的instance,若成员变量包括T*/ T&, 这种设计叫做“aggregation”(聚合);而若采用T 形式,则称为"composition"(组合) 这个回答不错,百度知道:☛ 组合和聚合的区别? 怎样看待“引用类型作为类的成员变量”? 参考StackOver 阅读全文

posted @ 2018-06-17 18:56 王家恒 阅读(864) 评论(0) 推荐(0) 编辑

导航