c++ deleting vector class member memory in destructor

前端 未结 4 2050
天涯浪人
天涯浪人 2021-01-19 16:42

I have a class containing a vector member variable. I know that vectors stored on the stack will be cleaned up (i.e. memory free\'d) when they go out of scope, but I\'m not

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-19 17:24

    The destructor for the vector will be called when you destroy an instance of fred.

提交回复
热议问题