Open HypnoS-s opened 9 years ago
C++ primer 5th Page 322.Exercise 8.12
Why didn’t we use in-class initializers in PersonInfo?
答案是
Cause we need a aggregate class here. so it should have no in-class initializers.
这里为什么需要aggregate class? 我觉得原因应该是没有必要这么做吧。
。。书上的PersonInfo 就已经是aggregate class了。
PersonInfo
@Mooophy 我也看到这里了,为什么没有在 PersonInfo 类中使用类内初始化?
答案说我们需要聚合类,为什么需要聚合类呢?
這個情境下對 PersonInfo 做任何預設初始化應該都不合理? 給它一個預設號碼或名稱應該沒有意義
C++ primer 5th Page 322.Exercise 8.12
答案是
这里为什么需要aggregate class? 我觉得原因应该是没有必要这么做吧。