title: problem sorting using member function as comparator
body: <p>trying to compile the following code I get this compile error, what can I do?</p>
  
  <hr>
  
  <blockquote>
    <p>ISO C++ forbids taking the address of
    an unqualified or parenthesized
    non-static member function to form a
    pointer to member function.</p>
  </blockquote>
  
  <pre><code>class MyClass {
     int * arr;
     // other member variables
     MyClass() { arr = new int[someSize]; }
  
     doCompare( const int &amp; i1, const int &amp; i2 ) { // use some member variables } 
  
     doSort() { std::sort(arr,arr+someSize, &amp;doCompare); }
  
  }; 
  </code></pre>