This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/67085] priority queue should not copy comparators when calling push_heap and pop_heap


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]