You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kalinosia edited this page Mar 13, 2021
·
1 revision
„If your class needs custom destructor, copy constructor, or assignment operator, then most likely you have to explicitly define all of them.”*since C++11, we also have to take care of move constructor and move assignment operator.
WHY?!
because when in constructor (exapmle default) we give some ptr and we don't have copy constructor, while coping we don't get ptr. In destructor we have delete ptr. So what will happen when we call destructor while don't have ptr (from coping..).