C++ : handle resources if constructors may throw exceptions (Reference to FAQ 17.4]

后端 未结 4 654
故里飘歌
故里飘歌 2020-12-02 01:41

Thanks for all the response.

I reformatted my question to understand the state of the member pointer after the containg class constructor throws an exception

4条回答
  •  感情败类
    2020-12-02 02:13

    The destructor for p will not be called, if the memory allocation for p fails.

提交回复
热议问题