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: [Patch] libstdc++/23425


Hi,

> clear() is best not thought of as a special case of erase().  It is 
> best thought of as a special case of a private function which I'll call:
>
> void __erase_at_end(size_type n);
>
> Erases the last n elements from the vector.  This is needed in the 
> following public members of vector:
>
> All forms of assign.
> All forms of erase.
> All forms of resize.
> clear.

Howard, makes sense to you that essentially the same optimization is
possible for std::deque? I'm looking at the code and, besides the
additional complexity of freeing the nodes, it seems everything is very,
very similar. I can work on that too in the branch.

Paolo.


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