title: Don't print trailing delimiter stream_iterator C++
body: <p>What is the most elegant way, in your opinion, to print to <code>std::cout</code> using <code>std::ostream_iterator</code> in C++11 and avoid printing a trailing delimeter? </p>
  
  <p>The object I'm printing has bidirectional iterators, but not random access iterators. </p>
  
  <pre><code>std::list&lt;double&gt; x{1,2,3,4,5,6};
  std::copy(x.begin(), std::prev(x.end()),
                  std::ostream_iterator&lt;int&gt;(std::cout, ",") );
  if ( x.size() != 0 )
    std::cout &lt;&lt; *(--x.end()) &lt;&lt; std::endl;
  </code></pre>