I have requirement: for a function, I get the input as a stream of numbers. I mean, the function keeps on getting called with single number in each call. I am using std::q
std::q
Added this to my growing list of 'make STL readable' functions:
template void Clear(std::queue& Queue) { Queue = std::queue(); // Assign to empty queue }
It's just a wrapper around sellibitze's excellent answer, but means I don't have to also add a comment every time I use the technique.