title: C++ Equals Operator
body: <p>I have the following equals operator:</p>
  
  <pre><code>  bool operator==(const Duration&amp; x, const Duration&amp; y){
          return ( x.hrs == y.hrs, x.mins == y.mins, x.secs == y.secs );
      }
  </code></pre>
  
  <p>I have also tried:</p>
  
  <pre><code> bool operator==(const Duration&amp; x, const Duration&amp; y){
          return ( (x.hrs == y.hrs) &amp;&amp; (x.mins == y.mins) &amp;&amp; (x.secs == y.secs) );
      }
  </code></pre>
  
  <p>In my main method I have:</p>
  
  <pre><code>  //Arbitrary Durations - Testing
      Duration dTest0 (01,45,12);
      Duration dTest1 (01,35,45);
      Duration dTest2 (01,35,45);
      Duration dTest3 (01,25,05);
  
      if ( dTest0 == dTest1 ){
          cout&lt;&lt; "broken" &lt;&lt; endl;
      }
      else{
          cout&lt;&lt; "working" &lt;&lt; endl;
          }
  </code></pre>
  
  <p>My program keeps outputting "broken" which suggests that dTest0 and dTest1 are infact equal... Where am I going wrong?</p>
  
  <p>Additional: If I use <code>x.getHours == y.getHours...</code> It puts a red line under the <code>"."</code> and says: 'Error: a pointer to a bound function may only be used to call the function`.</p>
  
  <p>Any advice would be appreciated. Thanks.</p>