title: Pointer to member functions - C++ std::list sort
body: <p>How do i pass a pointer to a member function to std::list.sort()? </p>
  
  <p>Is this possible? Thanks</p>
  
  <pre><code>struct Node {
         uint32_t ID;
         char *   Value;
  };
  
  class myClass {
            private:
              uint32_t  myValueLength;
            public:
              list&lt;queueNode *&gt; MyQueue;
              bool compare(Node * first, Node * second);
              bool doStuff();
  }
  
  bool myClass::compare(Node * first, Node * second) {
      unsigned int ii =0;
      while (ii &lt; myValueLength)
      {
          if (first-&gt; Value[ii] &lt; second-&gt; Value[ii]) 
          {
              return true;
          } else if (first-&gt; Value[ii] &gt; second-&gt; Value[ii])
          {
              return false;
          }
  
          ++ii;
      }
  
      return false;
  }
  
  bool myClass::doStuff()
  {
      list.sort(compare);
  }
  </code></pre>
  
  <p>I want to use a length variable from within the class instead of doing strlen() within the compare function (The Value will always be the same length)</p>
  
  <p>Edit: The myValueLength was not the only variable i wanted to access from within the comparison function I just simplified it to make the example shorter. </p>