title: more than one operator ">>" matches these operands
body: <p>Wherever I use ">>" with stringstream it gives me that error. I don't see why I should be getting this error because I have only overloaded >> to work with <code>AbsClass</code>, not with any other types.</p>
  
  <pre><code>#include "Queue.h"
  #include "AbsClass.h"
  #include &lt;fstream&gt;
  #include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;sstream&gt;
  
  using namespace std;
  
  
  int main()
  {
      ifstream read;
      try
      {
          read.open( "TopicGin.txt" );
          if (!read)
          throw QueueException();
      }
      catch ( QueueException&amp; )
      {
          cerr &lt;&lt; "Could not find input file.\n";
          char endchar = getchar();
  
          if(endchar == '\nn')
          return 0;
      }
  
      string line;
  
      getline( read, line );
  
      stringstream stream;
  
      stream &lt;&lt; line;
  
      int buffer;
  
      Queue &lt;int&gt; q1;
  
      while ( stream &gt;&gt; buffer )
      {
          q1.enqueue( buffer );
          cout &lt;&lt; buffer &lt;&lt; ' ';
          cout &lt;&lt; "count is ";
          q1.displayCount();
  
      }
  
      cout &lt;&lt; q1.peek();
  
      q1.dequeue();
  
      cout &lt;&lt; q1.peek();
  
      Queue&lt;int&gt; q2 = q1;
  
      q2.peek();
  
      cout &lt;&lt; "\n The contents of q2 with queue size " &lt;&lt; q2.getSize() &lt;&lt; " are: \n"; 
      q2.displayArray();
  
      //NEED EXCEPTIONS FOR THIS PART JUST SEETING UP 
      cout &lt;&lt; " Attempt to create a queue of int with an invalid size.\n";
  
      Queue&lt;int&gt; q3(-1);
  
      cout &lt;&lt; "Create queue object of double q4 with a size of 14.\n";
  
      Queue&lt;double&gt; q4(14);
  
      cout &lt;&lt; "Read in values from the input file. \n";
  
      stream.clear(); 
  
      double dBuf;
  
      getline ( read, line );
  
      stream &lt;&lt; line;
  
      while ( stream &gt;&gt; dBuf )
      {
          q4.enqueue( dBuf );
          cout &lt;&lt; dBuf &lt;&lt; ' ';
          cout &lt;&lt; "count is ";
          q4.displayCount();
  
      }
  
      cout &lt;&lt; fixed &lt;&lt; setprecision(2);
      cout &lt;&lt; q4.peek();
      q4.dequeue();
      cout &lt;&lt; q4.peek();
  
      cout &lt;&lt; "Create Queue object of 5 which is a copy of q4\n";
  
      Queue&lt;double&gt; q5 = q4;
  
      q5.peek();
  
      q5.displayArray();
  
  
      //EXCEPTIONS AGAIN DLFKJALDKAJ
  
      cout &lt;&lt; "Attempt to peek an empty queue. \n";
      Queue&lt;double&gt; q6;
      q6.peek();
  
  
      cout &lt;&lt; "Create Queue object of AbsClass q7 with default size. \n";
      cout &lt;&lt; "Read in values from input file \n";
  
      Queue&lt;AbsClass&gt; q7;
  
      cout &lt;&lt; "Read in values from the input file. \n";
  
      AbsClass AbsBuf;
  
      getline ( read, line );
  
      stream.clear(); 
  
      stream &lt;&lt; line;
  
      while ( stream &gt;&gt; AbsBuf)
      {
          q7.enqueue( AbsBuf );
          cout &lt;&lt; AbsBuf   &lt;&lt; ' ';
          cout &lt;&lt; "count is ";
          q7.displayCount(); 0
      }
      return 0;
  }
  </code></pre>
  
  <p>l</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cmath&gt;
  #include &lt;string&gt;
  // JAMES: ADDED THIS:
  #include &lt;sstream&gt;
  
  using namespace std;
  
  // JAMES: ADDED THIS:
  stringstream&amp; operator&gt;&gt;( stringstream&amp; stream, AbsClass&amp; obj );
  
  class AbsClass
  {
  public:
      AbsClass(int val = 0){num = abs(val);} // Inlined constructor
  
      int getNum()const {return num;}
  
      // JAMES: ADDED THIS:
      void setNum( int newNum ) { num = abs(newNum ); } 
  
  private:
      int num;
  };
  
  // JAMES: ADDED THIS:
  stringstream&amp; operator&gt;&gt;(stringstream&amp; stream, AbsClass&amp; obj)
  {
    int buffer;
    stream &gt;&gt; buffer;
  
    obj.setNum( buffer );
  
    return stream;
  }
  </code></pre>
  
  <p>k</p>
  
  <pre><code>#include "AbsClass.h"
  #include &lt;sstream&gt;
  
  using namespace std;
  
  
  // JAMES: ADDED THIS:
  istream&amp; operator&gt;&gt;( istream&amp; stream, AbsClass&amp; obj );
  
  istream&amp; operator&gt;&gt;( istream&amp; stream, AbsClass&amp; obj )
  {
      int buffer;
      stream &gt;&gt; buffer;
      obj.setNum( buffer );
      return stream;
  }
  </code></pre>