title: Why does this custom comparator for sets in c++ behave like this?
body: <p>I have a set of structs where the struct is</p>
  <pre><code>struct sub_tree
  {
      vector &lt;int&gt; nodes;
      int weight;
  };
  </code></pre>
  <p>and the set along with the comparator function is</p>
  <pre><code>set &lt;sub_tree, decltype (comp)*&gt; s(comp);
  bool comp (sub_tree a, sub_tree b)
  {
      return (a.weight &lt; b.weight);
  }
  </code></pre>
  <p>Now when I input two structs with the same weight but different node vectors, like weight1 = 96 node1 = 5 and weight2 = 96 node2 = 6 it accepts only the first one in the set.
  But if I use the following comparator then it accepts both the values.</p>
  <pre><code>set &lt;sub_tree, decltype (comp)*&gt; s(comp);
  bool comp (sub_tree a, sub_tree b)
  {
      return (a.weight &lt;= b.weight);
  }
  </code></pre>
  <p>Can someone explain this behavior?</p>