logoalt Hacker News

kccqzyyesterday at 9:24 PM0 repliesview on HN

You can also do that intentionally and correctly. After all `delete this;` is a valid statement that can occasionally be useful. That said, I’ve only seen this in old pre-C++11 code that does not adhere to the RAII best practice.