3 ms·
In C++ you can write the cleanup code once in the destructor, "similar constructions in other languages" must be written every time you use it. You can and sho
by ExpiredLink 15y ago
In C++ you can write the cleanup code once in the destructor,
"similar constructions in other languages" must be written every time you use it. You can and should do "non-trivial cleanup in destructors", e.g. DB rollback, but you should do only cleanup in destructors.