ifstream overload with issue passing value to operator overload
<p>C++ Regarding Passing Value to ifstream issue</p>

<p>At main.cpp</p>

<pre><code>int main()
{
  vector&lt;String&gt; lineContent;
  string filename;
  filename = "somefile.txt";

  while(readFile.good())
  {
    getline(readFile, readLine);
    vectContent.clear();

    //line content is a vector
    //split string input (string line, string delimiter , vector&lt;String&gt; &amp;s)
    splitString(readLine,",",lineContent);

    //assume i got a function which does trim of whitespace front and back..
    vectContent = trim(lineContent[0]);

    if(classType="Map2D")
    {
      Map2D m2d_temp;
      readFile &gt;&gt; m2d_temp;
    }
  }//end while good

}
</code></pre>

<p>At map2d.cpp</p>

<pre><code>ifstream&amp; operator&gt;&gt;(ifstream &amp;in,Map2D &amp;map2d)
{
  int xData;
  input.ignore(2);
  input&gt;&gt;xData;

  cout &lt;&lt; xData &lt;&lt; " " &lt;&lt; yData &lt;&lt; endl;
}
</code></pre>

<p>I think the problem is because instead of using the normal way to read file, i read it by getline..</p>

<p>if i use </p>

<pre><code>readLine.getline(line,20,',');
</code></pre>

<p>then the passed in value - input  have no issue and able to obtain the line content.</p>

<p>So should i do to retain my way of getLine and yet able to pass in stream.</p>
