Is it valid to call some function in destructor with this argument?
Function does not store pointer, but assume full-functional object.
Is it valid to call some function in destructor with this argument? Function does
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
thisis still valid in the destructor.However, you need bear in mind that virtual functions no longer work
properlyas you might expect once the object is being destroyed; see e.g. Never Call Virtual Functions during Construction or Destruction. Essentially, the dynamic type of the object is modified as each destructor completes.