title: Overload operator* to get reference to instance of another class
body: <p>I have classes</p>
  
  <pre><code>class Square
  {
  public:
      virtual void apply(Player*) = 0; //apply square effect to the player
  };
  
  class BoardIterator
  {
  public:
      BoardIterator();
      Square &amp;operator*();//return current square where player is
      Square &amp;operator+(int);//move forward certain number of squares
  private:
      static const int pathLength = 8;//length of outer path
      static const int innerPathLength = 4;//length of inner path
      int curPosition;//number of current square
      Square *outerPath[pathLength];
      Square *innerPath[innerPathLength];
  };
  
  class UpdateStatusSquare : public Board::Square
  {
  public:
      void apply(Player*);
  };
  
  /*
  Square where player can choose career path
  */
  class CareerSquaere : public Board::Square
  { 
  public:
      void apply(Player*);
  };
  </code></pre>
  
  <p>*boardIterator has to return reference to Square object.
  This is my implementation of this operator</p>
  
  <pre><code>Board::Square&amp; Board::BoardIterator::operator*()
  {
       return *(outerPath[curPosition]);
  }
  </code></pre>
  
  <p>I try to test this in this way</p>
  
  <pre><code>Board::BoardIterator iter;
  UpdateStatusSquare x = *iter;
  </code></pre>
  
  <p>But I have </p>
  
  <blockquote>
    <p>Error C2440   'initializing': cannot convert from 'Board::Square' to
    'UpdateStatusSquare'  CareersGame</p>
  </blockquote>
  
  <p>How should I implement this overloading in right way?</p>