This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/41351] std::rotate on RAI does not conform to ISO complexity requirement
- From: "chris at bubblescope dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Sep 2009 17:00:30 -0000
- Subject: [Bug libstdc++/41351] std::rotate on RAI does not conform to ISO complexity requirement
- References: <bug-41351-18186@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from chris at bubblescope dot net 2009-09-14 17:00 -------
You cannot assume the elements you are sorting have a default constructor. You
can however certainly use a separate array of indices, and then swap at the
end, so I withdraw that comment. However, this also only complicates the
problem, as it suggests we should also fix stable_partition.
A long time ago I tried improving the standard library to use whichever of swap
or copy was more efficent, and ended up effectively reinventing rvalue
references using template wrappers.
Given any patches would only be in a new version of gcc, as this is not a
regression, as we haw never done it "properly", would you be happy instead
using the c++0x support in those new compiler?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41351