This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/48038] [C++0x] stable_sort problem with C++0x and comparator by value
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 9 Mar 2011 15:53:49 +0000
- Subject: [Bug libstdc++/48038] [C++0x] stable_sort problem with C++0x and comparator by value
- Auto-submitted: auto-generated
- References: <bug-48038-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48038
--- Comment #24 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-09 15:53:43 UTC ---
Chris, thanks for dealing with this so quickly.
A small nit, in the new testcase I think the move-assignment operator should
use
ok = rh.ok;
instead of
ok = true;
to preserve the "moved-from-ness" of the source.
i.e. move-assigning from a moved-from value should make the target have the
same "valid but unspecified state" as the source.
That's certainly what happens if you move-assign from e.g. an empty unique_ptr,
you don't summon up a new pointee out of nowhere!