- 博客(2)
- 资源 (1)
- 收藏
- 关注
转载 Memory Layout of C++ Object in Different Scenarios
n this article, we will see the memory layout of different C++ Object. And how different storage & access specifiers affect this memory footprint. I am not going to discuss compiler augmented code, name mangling & working of any C++ mechanism relat
2021-10-21 22:19:59 169
原创 (C++)upcast的时候一定要用 dynamic_cast 吗?
如果是多继承,并且 upcast到不同的接口的时候,需要用dynamic_cast 比如,下面的代码,第37行一定要用 dynamic_cast,因为它是从一个 基类接口转到另外一个基类借口。 1 class A 2 { 3 public: 4 virtual bool IsA(void) = 0; 5 protected: 6 int t_a; 7 }; 8 9 class B 10 { 11
2021-10-18 23:05:50 212
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人