From: Warren Young Date: December 28 2007 9:21am Subject: Re: problems in ConnectionPool List-Archive: http://lists.mysql.com/plusplus/7316 Message-Id: <4774C020.4030304@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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.