I am teaching destructors in C++ and would like to give the students an interesting homework exercise that requires them to build a class with destructor.
In previous years, the homework were something like "write a linked list, but do not use the classes in the STL". I do not like this - I tell my students that they can use whatever feature of the language that they want, even if we did not learn it in class yet.
The problem is, for every other exercise that I could think of (e.g, tree, graph, etc.) I could easily think of a solution using STL features, that does not require any destructor.
What is an interesting exercise where destructors are really needed?