I need to be able to add (append) the contents of one std::queue to another, preferably in much the same way as using std::deque::insert, but using std::vector? I would prefer to continue using std::vectors, rather than a major rewrite to implement std::deques.
As with some of my previous posts in this same project, I have limited mobility in terms of what I can use having to work with some legacy code. And much of that limitation has to do with speed. Nevertheless, members of this forum have come up with some elegant and unique solutions; and I'm hoping to find another.
// This works...
std::deque<std::vector<uint8_t>> aaa;
std::deque<std::vector<uint8_t>> bbb;
aaa.insert(aaa.end(), bbb.begin(), bbb.end());
// This, of course, does not work...
std::queue<std::vector<uint8_t>> ccc;
std::queue<std::vector<uint8_t>> ddd;
ccc.insert(ccc.end(), ddd.begin(), ddd.end());
Obviously will not compile as insert is not supported for ccc type std::queue
A few important notes: There will never be a case where the container being used (queue, deque, etc) will need anything other than FIFO. Also, the processing handles queue volumes in the range of 80,000 to 100,000 elements per second, often very small, occasionally very large.