title: std::vector to string with custom delimiter
body: <p>I would like to copy the contents of a <code>vector</code> to one long <code>string</code> with a custom delimiter. So far, I've tried:</p>
  
  <pre><code>// .h
  string getLabeledPointsString(const string delimiter=",");
  // .cpp
  string Gesture::getLabeledPointsString(const string delimiter) {
      vector&lt;int&gt; x = getLabeledPoints();
      stringstream  s;
      copy(x.begin(),x.end(), ostream_iterator&lt;int&gt;(s,delimiter));
      return s.str();
  }
  </code></pre>
  
  <p>but I get </p>
  
  <pre><code>no matching function for call to ‘std::ostream_iterator&lt;int, char, std::char_traits&lt;char&gt; &gt;::ostream_iterator(std::stringstream&amp;, const std::string&amp;)’
  </code></pre>
  
  <p>I've tried with <code>charT*</code> but I get </p>
  
  <pre><code>error iso c++ forbids declaration of charT with no type
  </code></pre>
  
  <p>Then I tried using <code>char</code> and <code>ostream_iterator&lt;int&gt;(s,&amp;delimiter)</code>
  but I get strange characters in the string.</p>
  
  <p>Can anyone help me make sense of what the compiler is expecting here?</p>