title: C++ Overloading operator< for struct: Error too many parameters
body: <p>For an assignment students have to make a Card struct that keeps the Suit, Rank and Bitmap of a Card. This struct needs an overloaded "&lt;" operator to compare whether the lhs Card's Rank is smaller than the rhs Card and return the bool. So far this is my Card.h file:</p>
  
  <pre><code>#pragma once
  
  #include "GameEngine.h"
  
  struct Card
  {
  
  public:
  //Constructor and Destructor
  Card();
  virtual ~Card();
  
  //Methods
  bool operator&lt; (const Card&amp; lhs, const Card&amp; rhs)
  {
      return (lhs.m_Rank &lt; rhs.m_Rank);
  }
  
  //Enumerations
  enum class Suit
  {
      Diamonds,
      Clubs,
      Hearts,
      Spades,
  };
  
  enum class Rank
  {
      RankAce,
      RankTwo,
      RankThree,
      RankFour,
      RankFive,
      RankSix,
      RankSeven,
      RankEight,
      RankNine,
      RankTen,
      RankJack,
      RankQueen,
      RankKing,
  };
  
  private:
  //Datamembers
  Bitmap *m_BmpPtr;
  Rank m_Rank;
  Suit m_Suit;
  };
  </code></pre>
  
  <p>However the operator&lt; overload claims that it has too many parameters. Isn't this the right way to make sure both lhs and rhs can be compared in one overload? It's not like I have to split it up right?</p>
  
  <p>Many thanks in advance.</p>