How to do the equivalent of memset(this, …) without clobbering the vtbl?

后端 未结 7 1099
粉色の甜心
粉色の甜心 2020-11-29 10:39

I know that memset is frowned upon for class initialization. For example, something like the following:

class X { public: 
X() { memset( this,          


        
7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 11:23

    You could always add constructors to these embedded structures, so they clear themselves so to speak.

提交回复
热议问题