title: Custom comparison operator and custom class for std::set in C++
body: <p>I would like to create a set containing the objects of my class, I have to determine a custom comparison. Unfortunately, everything I tried did not work.</p>
  
  <pre><code>class My_Class {
      public:
          char letter;
          set&lt;My_Class, compare&gt; Children;
  };
  </code></pre>
  
  <p>Ant then, the compare struct:</p>
  
  <pre><code>struct compare {
      bool operator() (const My_Class&amp; a, const My_Class&amp; b) const{
          return a.letter &lt; b.letter;
      }
  };
  </code></pre>
  
  <p>How can I make this work please?</p>
  
  <p>Currently, the issue displays that identifiers <code>a</code> and <code>b</code> are not declared.</p>