What happens if you call delete this in the destructor?
delete essentially performs 2 operations:
1. explicit call of the object destructor and
2. freeing up the memory occupied by the object
So calling in the destructor delete this will lead to an infinite loop, which, in turn, will lead to a stack overflow and the program will crash.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Зареєструйся Зараз
або Підпишись на майбутні тести