title: Not able to understand the meaning of this code
body: <p>I dont understand what the following code is doing</p>
  
  <pre><code>auto sgn = [&amp;](int x) 
  {
          if (x &gt; 0) return 1;
          else return -1;
  };
  </code></pre>
  
  <p>What is the role of ampersand here? Is it a pointer? And is this block a structure or something like that? </p>
  
  <p>I came across this block of code in codeforces round 636 division 3 editorial.</p>