This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: debug shrink_to_fit


On 06/09/2011 10:39 PM, Paolo Carlini wrote:
On 06/09/2011 10:20 PM, François Dumont wrote:
Here is a new proposition:
This is NOT ok, you can't change shrink_to_fit itself to return a bool. Plus there are many completely unexplained changes.
In practice, it seems to me that you have only two possibilities:
1- As I suggested a few days ago, simply call __shrink_to_fit both from the normal implementation and the debug-mode implementations of shrink_to_fit. The return value is checked in the latter case for _M_invalidate_all, etc.
2- Go for something more complex, and tailored to each specific container (I'm not sure it's worth it, but anyway): in that case you want a member function _M_shrink_to_fit in the normal-mode class, called, again, both by normal-mode and debug-mode shrink_to_fit.


Paolo.

PS: stylistically, open curly braces always begin a new line.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]