[PATCH] PR libstdc++/91620 Implement DR 526 for std::[forward_]list::remove_if/unique
François Dumont
frs.dumont@gmail.com
Fri Dec 27 10:57:00 GMT 2019
Here is the patch to extend DR 526 to forward_list and list remove_if
and unique.
As the adopted pattern is simpler I also applied it to the remove methods.
   PR libstdc++/91620
   * include/bits/forward_list.tcc (forward_list<>::remove): Collect nodes
   to destroy in an intermediate forward_list.
   (forward_list<>::remove_if, forward_list<>::unique): Likewise.
   * include/bits/list.tcc (list<>::remove, list<>::unique): Likewise.
   (list<>::remove_if): Likewise.
   * include/debug/forward_list (forward_list<>::_M_erase_after): Remove.
   (forward_list<>::erase_after): Adapt.
   (forward_list<>::remove, forward_list<>::remove_if): Collect nodes to
   destroy in an intermediate forward_list.
   (forward_list<>::unique): Likewise.
   * include/debug/list (list<>::remove, list<>::unique): Likewise.
   (list<>::remove_if): Likewise.
Tested under Linux x86_64 normal and debug modes.
Ok to commit ?
François
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 91620.patch
Type: text/x-patch
Size: 14757 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20191227/fad334c1/attachment.bin>
More information about the Libstdc++
mailing list