How to deallocate object pointer in vector?

后端 未结 7 1396
野趣味
野趣味 2021-02-06 12:30

I have ;

class object {
                    // any private datas token in heap area 
             public : 
                   ~object () ; 

};
<
7条回答
  •  醉酒成梦
    2021-02-06 13:15

    You can use vector::erase..

    And your object destructor should delete all the members you have allocated in heap.

提交回复
热议问题