vector::push_back not work for non default constructor

后端 未结 4 1112
萌比男神i
萌比男神i 2021-01-28 13:26

i have a Controls class that have default constructor and copy constructor and other constructor ,and an assignment operator , and i want to create array of my cla

4条回答
  •  滥情空心
    2021-01-28 14:27

    Also, I think the problem is with your auto_ptr variables. You should check if it is really the way how you want to treat your object pointers. I would rather stick with the shared_ptr or unique_ptr. In the latter case however, you don't want to have copy constructor at all, as there could be only one owner of the pointers.

    C++ std::auto_ptr copy constructor

提交回复
热议问题