title: questions about an article introducing C++ interface
body: <p>I have been reading an article about C++ interfaces (<a href="http://accu.org/index.php/journals/233" rel="nofollow noreferrer">http://accu.org/index.php/journals/233</a>) and I am completely lost at the part where it says all the virtual member functions should be made private (the section titled "Strengthening the Separation"). It just does not make sense to me at all.</p>
  
  <p>According to the author, the code is like this:</p>
  
  <pre><code>class shape {
  public:
    virtual ~shape();
    virtual void move_x(distance x) = 0;
    virtual void move_y(distance y) = 0;
    virtual void rotate(angle rotation) = 0;
    //...
  };
  
  class line : public shape {
  public:
    line(point end_point_1, point end_point_2);
    //...
  private:
    virtual ~line();
    virtual void move_x(distance x);
    virtual void move_y(distance y);
    virtual void rotate(angle rotation);
    //...
  };
  </code></pre>
  
  <p>So we have a pure virtual function which is public, and its implementation (in the line class) which is private.</p>
  
  <p>Could anybody explain how the move_x function can be called? Its access specifier is private, it will lead to an error if I try to do this:</p>
  
  <pre><code>line my_line(point(0,0), point(1,2));
  my_line.move_x(-1); // does not compile
  </code></pre>
  
  <p>Similarly is it correct to say that the drawing interface (see earlier in the article)cannot access these functions either?</p>
  
  <p>Thank you.</p>