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
When using auto_ptr
you should use release
not get
to pass the pointer to new owner:
Not this in Controls::Controls(QLayout &Parent , string name , const int &Default_value)
:
Layout.addWidget(Label.get() , 0 , 0);
But that:
Layout.addWidget(Label.release() , 0 , 0);
Otherwise - your auto_ptr
are deleting the pointers at the end of scope of this constructor.