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: "vincenzo.innocente at cern dot ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 9 Mar 2011 15:28:12 +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 #21 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2011-03-09 15:27:49 UTC ---
On 9 Mar, 2011, at 1:46 PM, paolo.carlini at oracle dot com wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48038
>
> --- Comment #16 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-03-09 12:46:07 UTC ---
> By the way, as a note to Vincenzo, in general I don't really see the point of
> comparators taking the arguments by value, thus ruling out move-only types,
> among other issues (that clearly shows up in other areas of C++0x). In other
> terms, I don't see the temporary workaround for this issue as a proper
> workaround, more as a best practice ;)
>
The bug showed up initially in a real-software use case were we use a vector of
smart pointer which are typically handled by value.
I then resued an old test of mine to fast prove that the issue was in gcc 4.6.
I will try to build an example using std::shared_ptr (ours are boost intrusive
shared pointers!)
if is of interest for you.
vincenzo