title: lambda function doesn't work in priority_queue in c++ (when using [&])
body: <p>When I am doing Leetcode.com, the following code cannot be compiled. </p>
  
  <pre><code>auto cmp=[&amp;](pair&lt;int,int&gt; a, pair&lt;int,int&gt; b){return heightMap[a.first]
           [a.second]&lt;heightMap[b.first][b.second];};
  
  priority_queue&lt;pair&lt;int,int&gt;,vector&lt;pair&lt;int,int&gt;&gt;,decltype(cmp)&gt; pq;
  </code></pre>
  
  <p>It works well when I use </p>
  
  <pre><code>auto cmp=[](...){return true;}.
  </code></pre>
  
  <p>But I have to use </p>
  
  <pre><code>auto cmp=[&amp;](...){...}
  </code></pre>
  
  <p>because I need to access heightMap in the function.</p>
  
  <p>I don't know why this cannot be compiled</p>