This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/67085] priority queue should not copy comparators when calling push_heap and pop_heap
- 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: Tue, 04 Aug 2015 09:13:23 +0000
- Subject: [Bug libstdc++/67085] priority queue should not copy comparators when calling push_heap and pop_heap
- Auto-submitted: auto-generated
- References: <bug-67085-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67085
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Andrew Calcutt from comment #3)
> Are there technical reasons this is not desirable or possible beyond what
> you have already stated? Is the behavior of the priority queue here also
> outside of the intent of the standard?
Yes, using a reference type for the comparison object of std::priority_queue is
highly quesitonable. Use std::reference_wrapper<C> if you want reference
semantics.