title: Create set with custom comparator passed as lambda
body: <p>I was writing the solution for <a href="https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/" rel="nofollow noreferrer">this</a> and needed to create a <code>set</code>, well actually an <code>unordered_map</code> from int to my custom <code>set</code>, without further ado, this is what I came up whith:</p>
  
  <pre><code>auto comparator = [](pair&lt;int, int&gt; a, pair&lt;int, int&gt; b) {return a.second == b.second ? a.first &lt; b.first : a.second &lt; b.second; };
  unordered_map&lt;int, set &lt; pair&lt;int, int&gt;,decltype(comparator) &gt;&gt; H;
  </code></pre>
  
  <p>The rest of code is not relevant. Here the compiler complains that  </p>
  
  <pre><code>"Severity   Code    Description Project File    Line    Suppression State
  &lt;lambda_6dd753bdcbaf959c162af7914f0815bf&gt;(void)': attempting to reference a deleted function"
  </code></pre>
  
  <p>Can anyone please describe that is compiler trying to tell me, or even better if you could hint what I have done wrong.   Thanks in advance.</p>