std::priority_queue<some_type, std::vector<some_type>, some_comparator> A; std::priority_queue<some_type, std::vector<some_type>, some_comparator> B;
How can I combine these priority queues A and B based on the same comparator. I tried to find a built-in function, but could not find it.
The easiest way is to simply move objects from one queue to another:
while(!B.empty()) { A.push(B.top()); B.pop(); }
However, a more efficient method may exist.
Source: https://habr.com/ru/post/949822/More articles:Android: TableLayout aligns the first column to the right, the second to the left - androidGoogle Map v2 inside fragment android - androidError with PHPUnit in Symfony2 - phpHow to center the span inside a TD? - javascriptIs there a preprocessor directive for detecting the C ++ 11 Standard standard library? - c ++Python logger prints lines multiple times - pythonfuzzy search with lucene - full-text-searchFTDI Change PID to default value - pidCommunication in ember - ember.jsadd the line to the file ONLY if it is not already in the file - linuxAll Articles