title: How to handle private class members in STL routines?
body: <p>When I use the sort routine for a vector of <code>Ereignis</code> class instances, I am comparing some private members in this routine. As I don't have a direct access to them, I am using public methods instead:</p>
  <pre><code>bool sort(Ereignis *ereignis1, Ereignis *ereignis2)
  {
      if (ereignis1-&gt;DatumHolen() &lt; ereignis2-&gt;DatumHolen())
          return true;
      else if (ereignis1-&gt;DatumHolen() == ereignis2-&gt;DatumHolen())
      {
          if (ereignis1-&gt;VeranstaltungHolen()-&gt;RangfolgeAmGleichenTagHolen() &lt; ereignis2-&gt;VeranstaltungHolen()-&gt;RangfolgeAmGleichenTagHolen())
              return true;
      }
      return false;
  }
  //---------------------------------------------------------------------------
  stable_sort(ereignisse.begin(), ereignisse.end(), sort); 
  </code></pre>
  <p>Is this really a good practice? I mean, STL methods have been designed to work in a very fast way. For that reason it would make more sense to use the private members directly instead of loosing some time accessing the public methods instead.</p>