memory layout of inherited class

后端 未结 5 659
不知归路
不知归路 2021-02-04 05:25

I\'m keen to know exactly how the classes will be arranged in memory esp. with inheritance and virtual functions.

I know that this is not defined by the c++ language st

5条回答
  •  眼角桃花
    2021-02-04 05:47

    Visual Studio atleast has a hidden compiler option /d1reportSingleClassLayout (starting at ~32:00).

    Usage: /d1reportSingleClassLayoutCLASSNAME where there shall be no whitespace between the compiler switch and CLASSNAME (obviously replace this with the name of the class you'e interested in).

提交回复
热议问题