title: Iterate over std::vector containing concurrent_queue<string>* and print the strings
body: <p>I am trying to debug a multithreaded system, to do that i need to log the content of a vector for an extended period (1 hour).
  I want to print all the strings contained in <code>vector&lt;concurrent_queue&lt;MyObject&gt;*&gt; myContainer</code>, I have tried the following:</p>
  
  <pre><code>for (auto q : myContainer)
      for(concurrent_queue&lt;MyObject&gt;::iterator i = q-&gt;unsafe_begin(); i != q-&gt;unsafe_end(); ++i)
          cout &lt;&lt; i-&gt;toString()&lt;&lt;endl;
  </code></pre>
  
  <p>But i get a debug assertion after few runs in <code>Visual Studio</code> in :</p>
  
  <p><code>msvcp110d.dll!Concurrency::details::_Concurrent_queue_iterator_rep::choose(unsigned __int64 k) Line 339    C++</code></p>
  
  <p>I am thinking it's caused by access violation caused by a race condition.</p>
  
  <p>How can i properly iterate over such structure without issues ?</p>