[patch] libstdc++/61023 - copy comparison functor in RB tree move assignment

Jonathan Wakely jwakely@redhat.com
Wed May 7 14:13:00 GMT 2014


As noted in the PR, the standard doesn't actually say what containers
should do with their functors on move construction/assignment.

Our unordered containers currently move the hash and predicate
functions.

Our RB trees copy the comparison function in the move constructor but
do nothing with it in the move assignment. I think moving in both
cases is probably correct, but rather than change the existing move
constructor this patch just makes the move assignment copy the
function, for consistency.

When the standard is clarified we can review whether we should be
moving instead of copying.

Tested x86_64-linux, committed to trunk and the 4.9 branch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 2586 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20140507/3ad102fc/attachment.bin>


More information about the Libstdc++ mailing list