title: What can be a reason for making some class-specific functionality a separate function instead of member function?
body: <p>While reviewing rather old code I found some strange design decision:</p>
  
  <pre><code>// irrelevant stuff removed
  class Class {
  public:
     int GetStage() const { return stage; }
     void SetStage( int value ) { stage = value; }
  private:
     int stage;
  };
  
  void ProgressStage( Class* object )
  {
      int stage = object-&gt;GetStage();
      assert( stage &lt; MaxStage );
      stage++;
      object-&gt;SetStage( stage );
  }
  </code></pre>
  
  <p>now <code>ProgressStage()</code> is in the same header because it has to be visible at multiple call sites. It calls non-static member functions of the class. IMO it should be a member function instead:</p>
  
  <pre><code>void Class::ProgressStage()
  {
      //directly access member variables
      assert( stage &lt; MaxStage );
      ++stage;
  }
  </code></pre>
  
  <p>What could be the reason for preferring the former design to the latter?</p>