Talk:cpp/container/priority queue/emplace

Complexity
Should the complexity for be similar to, i.e. logarithmic plus whatever  takes? It looks like 23.6.4.3 says that just calls  and then re-heaps the container. --Nate (talk) 11:56, 21 January 2014 (PST)
 * Looks like you're right, it's defined just the same way as push is. --Cubbi (talk) 13:36, 21 January 2014 (PST)

Is void a correct return type in priority_queue::emplace
As per this doc: https://cplusplus.github.io/LWG/issue2783

Both stack and queue returns decltype(auto) for their emplace method. priority_queue is also a container adaptor and could use deque/list as it's container. Shouldn't the priority_queue::emplace also return decltype(auto) from C++17 ? pabitrapadhy (talk) 21:22, 11 April 2022 (PDT)ppadhy


 * Yeah void is still the return type. Having std return the reference given by emplace_back would be unhelpful after the std is performed, see for example --Ybab321 (talk) 02:27, 12 April 2022 (PDT)


 * right, LWG2783 only changed stack and queue; priority_queue is as before https://eel.is/c++draft/priqueue.members --Cubbi (talk) 06:31, 12 April 2022 (PDT)