[Bug libstdc++/59603] std::random_shuffle tries to swap element with itself

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 10 19:00:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59603

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Even if swapping an object with itself is well-defined it's a waste of time, so
we shouldn't do it.

There's a discussion happening now with the C++ library working group to
resolve whether self-move-assignment is user error or supposed to be allowed
(i.e. whether the debug mode assertion is ok or not)



More information about the Gcc-bugs mailing list