Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We can add code to destructors to do general stuff, not only deallocation. The same applies for constructors.

In C++ this works amazingly well for objects in the stack (not in the heap, as you need call the destructor yourself).



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: