Destructor not called after destroying object placement-new'ed

后端 未结 3 809
予麋鹿
予麋鹿 2021-02-19 14:21

I had no clue why this doesn\'t work. The following Function is created by placement new. A function is provided that checks whether it should be destructed, and if

3条回答
  •  走了就别回头了
    2021-02-19 15:09

    As I recall the destructor cannot be called explicitely. Try moving the cleanup code from destructor to other function and call it instead.

提交回复
热议问题