title: C++ ambiguous operator overload error
body: <p>I am finally getting my assignment to be almost complete, however now I am getting a whole new set of errors when I compile it.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class clockType
  {
        friend ostream&amp; operator&lt;&lt;(ostream&amp;, const clockType&amp;);
        friend istream&amp; operator&gt;&gt;(istream&amp;, clockType&amp;);
  public:
        void setTime (int hours, int minutes, int seconds);
        void getTime (int&amp; hours, int&amp; minutes, int&amp; seconds) const;     
        clockType operator++();
        bool operator==(const clockType&amp; otherClock) const;
        bool operator!= (const clockType&amp; otherClock) const;
        bool operator&lt;=(const clockType&amp; otherClock) const;
        bool operator&lt;(const clockType&amp; otherClock) const;
        bool operator&gt;=(const clockType&amp; otherClock) const;
        bool operator&gt;(const clockType&amp; otherClock) const;
        clockType ();
        clockType (int hours = 0, int minutes = 0, int seconds = 0);
  private:
          int hr;
          int min;
          int sec;
  };
  clockType clockType::operator++()
  {
            sec++;
            if (sec &gt; 59)
            {
                sec = 0;
                min++;
                if (min &gt; 59)
                {
                        min = 0;
                        hr++;
                        if (hr &gt; 23)
                        hr = 0;
                }
            }
            return *this;
  }
  bool clockType::operator==(const clockType&amp; otherClock) const
  {
       return (hr == otherClock.hr &amp;&amp; min == otherClock.min &amp;&amp; sec == otherClock.sec);
  }
  bool clockType::operator&lt;=(const clockType&amp; otherClock) const
  {
       return ((hr &lt; otherClock.hr) || (hr == otherClock.hr &amp;&amp; min &lt; otherClock.min) || (hr == otherClock.hr &amp;&amp; min == otherClock.min &amp;&amp; sec &lt;= otherClock.sec));
  }
  bool clockType::operator!=(const clockType&amp; otherClock) const
  {
            return (hr != otherClock.hr || min != otherClock.min || sec != otherClock.sec);
  }
  bool clockType::operator&lt;(const clockType&amp; otherClock) const
  {
       return ((hr &lt; otherClock.hr) || (hr == otherClock.hr &amp;&amp; min &lt; otherClock.min) || (hr == otherClock.hr &amp;&amp; min == otherClock.min &amp;&amp; sec &lt; otherClock.sec));
  }
  bool clockType::operator&gt;=(const clockType&amp; otherClock) const
  {
       return ((hr &gt; otherClock.hr) || (hr == otherClock.hr &amp;&amp; min &gt; otherClock.min) || (hr == otherClock.hr &amp;&amp; min == otherClock.min &amp;&amp; sec &gt;= otherClock.sec));
  }
  bool clockType::operator&gt;(const clockType&amp; otherClock) const
  {
       return ((hr &gt; otherClock.hr) || (hr == otherClock.hr &amp;&amp; min &gt; otherClock.min) || (hr == otherClock.hr &amp;&amp; min == otherClock.min &amp;&amp; sec &gt; otherClock.sec));
  }
  
  void clockType::setTime(int hours, int minutes, int seconds)
  {
       if (0 &lt;= hours &amp;&amp; hours &lt; 24)
       hr = hours;
       else
       hr = 0;
       if (0 &lt;= minutes &amp;&amp; minutes &lt; 60)
       min = minutes;
       else
       min = 0;
       if (0 &lt;= seconds &amp;&amp; seconds &lt; 60)
       sec = seconds;
       else
       sec = 0;
  }
  void clockType::getTime(int&amp; hours, int&amp; minutes, int&amp; seconds)const
  {
       hours = hr;
       minutes = min;
       seconds = sec;
  }
  clockType::clockType(int hours, int minutes, int seconds)
  {
   setTime(hours, minutes, seconds);
  }
  ostream&amp; operator&lt;&lt;(ostream&amp; osObject, const clockType&amp; timeOut)
  {
           if (timeOut.hr &lt; 10)
           osObject &lt;&lt; '0';
           osObject &lt;&lt; timeOut.hr &lt;&lt; ':';
           if (timeOut.min &lt; 10)
           osObject &lt;&lt; '0';
           osObject &lt;&lt; timeOut.min &lt;&lt; ':';
           if (timeOut.sec &lt; 10)
           osObject &lt;&lt; '0';
           osObject &lt;&lt; timeOut.sec &lt;&lt; ':';
           return osObject;
  }
  istream&amp; operator&gt;&gt;(istream&amp; is, clockType&amp; timeIn)
  {
           char ch;
           is &gt;&gt; timeIn.hr;
           if (timeIn.hr &lt; 0 || timeIn.hr &gt;=24)
           timeIn.hr = 0;
           is.get(ch);
           is &gt;&gt; timeIn.min;
           if (timeIn.min &lt; 0 || timeIn.min &gt;= 60)
           timeIn.min = 0;
           is.get(ch);
           is &gt;&gt; timeIn.sec;
           if (timeIn.sec &lt; 0 || timeIn.sec &gt;= 60)
           timeIn.sec = 0;
           return is;
  }
  int main() 
  { 
     clockType  myClock(4, 9, 22);
     clockType yourClock ();
  
     cout &lt;&lt; "myClock = " &lt;&lt; myClock &lt;&lt; endl;
     cout &lt;&lt; "yourClock = " &lt;&lt; yourClock &lt;&lt; endl;
     cout &lt;&lt; "enter the time in form " &lt;&lt; "hr:min:sec ";
     cin &gt;&gt; myClock;
     cout &lt;&lt; endl;
     cout &lt;&lt; "The new time of myClock = " &lt;&lt; myClock &lt;&lt; endl; 
     ++myClock;
     cout &lt;&lt; "After incrementing the time, " &lt;&lt; "myClock = " &lt;&lt; myClock &lt;&lt; endl;
     yourClock.setTime(15, 20, 25);
     cout &lt;&lt; "After setting the time, " &lt;&lt; "yourClock = " &lt;&lt; yourClock &lt;&lt; endl;
     if (myClock == yourClock)
     cout &lt;&lt; "The times of myClock and " &lt;&lt; "yourClock are equal." &lt;&lt; yourClock &lt;&lt; endl;
     else
     cout &lt;&lt; "The times of myClock and " &lt;&lt; "yourClock are not equal." &lt;&lt; endl;
     if (myClock &lt;= yourClock)
     cout &lt;&lt; "The time of myClock is " &lt;&lt; "less than or equal to " &lt;&lt; endl &lt;&lt; "the time of yourClock " &lt;&lt; endl;
     else
     cout &lt;&lt; "The time of myClock is " &lt;&lt; "greater than the time of " &lt;&lt; "yourClock." &lt;&lt; endl;
     return 0;
  }
  </code></pre>
  
  <p>The error that I am getting is:</p>
  
  <blockquote>
    <p>In funct main();<br>
          call of overloaded 'clockType()' is ambiguous candidates are: clockType::clockTYpe(int, int, int) clockType::clockType().</p>
  </blockquote>
  
  <p>I am unsure of what this is asking of me or what the error really is.</p>