Destructor

Applies to: cpp

A destructor runs when an object is destroyed, releasing resources tied to the object's lifetime.

~File() { close(); }

See also: raii, class