title: Overloading operators in derived class
body: <p>Must I need to redefine all the overloading operators with derived type if I require to use them in derived class?</p>
  
  <p>The following code compiles fine:</p>
  
  <pre><code>class Point {
  
  public:
  
      Point(int X = 0, int Y = 0):x(X), y(Y) {}
  
      virtual ~Point() {}
  
      Point operator +(Point &amp;rhs) {
          return Point(x + rhs.x, y + rhs.y);
      }
  
  protected:
      int x, y;
  };
  
  class Vector : public Point {
  
  public:
  
      Vector(int X, int Y) : Point(X, Y) {}
  
      ~Vector() {}
  
      Vector operator +(Vector &amp;rhs) {
          return Vector(x + rhs.x, y + rhs.y);
      }
  };
  
  int main()
  {
      Vector v1(1, 2);
      Vector v2(3, 2);
  
      Vector v3 = v2 + v1;
  }
  </code></pre>
  
  <p>But from what I've read,</p>
  
  <p><em>C++ Primer 4th Ed.</em> Section 15.5.3.</p>
  
  <blockquote>
    <p>If a derived class wants to make all the overloaded versions available through its type, then it must either redefine all of them or none of them.</p>
  </blockquote>
  
  <p>Does the part of the quote "<code>none of them</code>" make any sense here?</p>