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]

[v3] Reuse existing elements in forward_list::assign()


This changes the forward_list::assign() members to assign to existing
elements instead of destroying them and reallocating new ones, as
allowed by the Sequence Container requirements.  The copy assignment
operator already did that, so now it uses assign().  For QoI we still
support non-assignable types by dispatching to different functions.
I've also added a test for the memory leak I fixed yesterday.

I'll have one more forward_list patch tomorrow to finish the allocator
support and I'll leave forward_list alone for 4.8

Tested x86_64-linux, committed to trunk.

Attachment: patch.txt
Description: Text document


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