title: Splitting a stringstream that contains comma separated entries
body: <p>I have two strings that look as follows:</p>
  
  <pre><code>string text1 = "you,are,good";
  string text2 = "1,2,3,4,5";
  stringstream t1(text1);
  stringstream t2(text2);
  </code></pre>
  
  <p>I'm using the following code to to parse it as comma separated data</p>
  
  <pre><code>template &lt;typename T&gt;
  std::istream &amp;operator&gt;&gt;(std::istream &amp;is, Array&lt;T&gt; &amp;t)
  {
      T i;
      while (is &gt;&gt; i)
      {
          t.push_back(i);
  
          if (is.peek() == ',')
              is.ignore();
      }
      return is;
  }
  </code></pre>
  
  <p>where "is" is t1 or t2. This separates text2 but fails with text1. Could you guys please help me with that and tell me why it doesn't work with strings?
  I need a general code that would parse strings and numbers.</p>
  
  <p>Thanks for any efforts :)</p>