title: How do you structure your comparison functions?
body: <p>I frequently encounter situations, especially with sorting in C++, where I am comparing a series of fields in order to compare a larger structure.  A simplified example:</p>
  
  <pre><code>struct Car{
      Manufacturer make;
      ModelName model;
      Year year;
  };
  
  bool carLessThanComparator( const Car &amp; car1, const Car &amp; car2 ){
      if( car1.make &lt; car2.make ){
          return true;
      }else if( car1.make == car2.make ){
          if( car1.model &lt; car2.model ){
              return true;
          }else if( car1.model == car2.model ){
              if( car1.year &lt; car2.year ){
                  return true;
              }
          }
      }
  
      return false;
  }
  </code></pre>
  
  <p>My instinctive approach seems cumbersome, especially for more than 3 fields.  How would you structure this series of comparisons in C++?  Do other languages provide a more succinct or elegant syntax?</p>