scalar deleting destructor issue

后端 未结 2 887
时光取名叫无心
时光取名叫无心 2021-02-08 11:59

I can\'t figure out why I get error for the code below.

The instances of object A will be pushed into a vector (vectorA.push_back(A a)) continu

2条回答
  •  暖寄归人
    2021-02-08 12:33

    My psychic debugging skills tell me that you forgot to implement a copy constructor for A which then results in a double deletion of a Recording when the copy is destroyed.

    The growth of the vector would trigger the copy-destroy pairs.

提交回复
热议问题