title: Use of undeclared identifier in sort list with custom function
body: <p>I'm trying to sort a list of a custom struct type, with a custom function I have write, but give me an error:</p>
  
  <blockquote>
    <p>Use of undeclared identifier</p>
  </blockquote>
  
  <pre><code>struct myStruct
  {
      int x1;
      int x2;
  };
  
  bool CompareData(const myStruct&amp; a, const myStruct&amp; b)
  {
      if (a.x1 &lt; b.x1) return true;
      if (b.x1 &lt; a.x1) return false;
  
      // a=b for primary condition, go to secondary
      if (a.x2 &lt; b.x2) return true;
      if (b.x2 &lt; a.x2) return false;
  
      return false;
  }
  
  void sortingList ()
  {
      std::list&lt;myStruct&gt; custom_dist;
      //...Fill list
      custom_dist.sort(CompareData); //Here i receive the error
  }
  </code></pre>
  
  <p>This is the error:</p>
  
  <p><img src="https://i.stack.imgur.com/qJ9hd.png" alt="enter image description here"></p>
  
  <p>beacuse seem that expects input parameters...</p>