title: "No viable overloaded '=' " why?
body: <p>I'm making a project for one of my classes and I'm pretty sure I'm almost done with the project. Basically I have to input 2 people's tickets and I have to find the maximum and minimum price. I need to overload the * and / operators to fix that issue for the project. Also, the <code>friend</code> declaration is a necessity for this project via teacher's instructions. </p>
  
  <p>Now, for the issue. I'm trying to store the proper ticket variable (either t1 or t2) into t3 so I can return that to the main. When I use "=" to set either t1 to t3, it says "no viable overloaded '='". The following is my code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class ticket
  {
  public:
      ticket();
      double input();
      double output();
      friend ticket operator *(const ticket &amp;t1, const ticket &amp;t2);
      friend ticket operator /(const ticket &amp;t1, const ticket &amp;t2);
  private:
      void cost();
      string name;
      double miles, price;
      int transfers;
  };
  
  
  int main()
  {
      ticket customer1, customer2, customer3;
  
      //------------------------------------------------
      cout &lt;&lt; "*** Customer 1 ***" &lt;&lt; endl;
      customer1.input();
      cout &lt;&lt; "--- Entered, thank you ---" &lt;&lt; endl;
  
  
      cout &lt;&lt; "*** Customer 2 ***" &lt;&lt; endl;
      customer2.input();
      cout &lt;&lt; "--- Enter, thank you ---" &lt;&lt; endl;
      //------------------------------------------------
  
  
  
      //------------------------------------------------
      cout &lt;&lt; "Testing of the * operator: " &lt;&lt; endl;
      customer3 = customer1 * customer2;
      cout &lt;&lt; "*** Database printout: ***" &lt;&lt; endl;
      customer3.output();
      cout &lt;&lt; endl;
      cout &lt;&lt; "--- End of Database ---" &lt;&lt; endl;
      //------------------------------------------------
  
  
      //------------------------------------------------
      cout &lt;&lt; "Testing of the / operator:" &lt;&lt; endl;
      customer3 = customer1 / customer2;
      cout &lt;&lt; "*** Database printout: ***" &lt;&lt; endl;
      customer3.output();
      cout &lt;&lt; endl;
      cout &lt;&lt; "--- End of Database ---" &lt;&lt; endl;
      //------------------------------------------------
  
  
          return 0;
  }
  
  ticket operator *(const ticket &amp;t1, const ticket &amp;t2)
  {
      ticket t3;
  
      if (t1.price &gt; t2.price)
          t3 = t1.price;
      else
          t3 = t2.price;
      return t3;
  }
  ticket operator /(const ticket &amp;t1, const ticket &amp;t2)
  {
      ticket t3;
  
      if (t1.price &lt; t2.price)
          t3 = t1.price;
      else
          t3 = t2.price;
          return t3;
  }
  ticket::ticket()
  {
  }
  
  double ticket::input()
  {
      cout &lt;&lt; "Miles? ";
      cin &gt;&gt; miles;
  
      cout &lt;&lt; endl &lt;&lt; "Transers? ";
      cin &gt;&gt; transfers;
  
      cout &lt;&lt; endl &lt;&lt; "Name? ";
      cin &gt;&gt; name;
  
      cost();
  
      cout &lt;&lt; endl &lt;&lt; "Price is: " &lt;&lt; price &lt;&lt; endl;
  
      return miles;
  }
  
  double ticket::output()
  {
      cout &lt;&lt; name &lt;&lt; '\t' &lt;&lt; miles &lt;&lt; "mi \t " &lt;&lt; transfers &lt;&lt; " transfers \t" &lt;&lt; price;
      return miles;
  }
  
  void ticket::cost()
  {
      price = (.5 * miles) - (50 * transfers);
  }
  </code></pre>