Jonathan Wakely wrote:
On further consideration, I wonder if clear() shouldn't be overloaded,
with one version being protected and taking a bool "force" parameter.
If force, destroying in-use connections is allowed. Else, not.
Ah yes, making it public means you have to worry about that.
Okay, the resolution is that clear() is protected again and takes a bool
parameter whose default of true makes it work the way clear() does in
STL. Then, added a public shrink() method that passes false to clear(),
making it remove only unused connections.