Passing iterator references to enqueue_bulk and variants #46
Description
Hi,
I am working on a channel abstraction over concurrentqueue; one of the features allows me to limit the number of elements in the queue dynamically.
It's similar to your blocking queue, but it allows me to change the capacity of the queue on the fly and it allows me to enqueue_bulk with a count much greater than the capacity.
I do this by waiting until there is some free space, filling that up with elements from the iterator and then repeating that until the iterator is empty.
To achieve this, I am passing a reference to the iterator my wrapper got rather than it's value, so outside of enqueue_bulk I my iterator will be incremented and in the next step I can just pass the same to enqueue_bulk again.
Unfortunately, eneuque_bulk decays my references to values. I was able to change this, but I am not quite sure this was by design.
Here is the code, hopefully with fewer bugs than the last one :)