title: Lambda function throwing error if return type is changed from auto to bool
body: <p>I was practicing lambda functions in C++, following code works fine</p>
  <pre><code>
  void insertionSort(int* a, int size, bool reverse=false) {
      auto comp = [](int a, int b, bool reverse) {
          return reverse ? a &gt; b : b &lt; a;
      };
      
      for (int i = 0; i &lt; size; i++) {
          int current = a[i];
          cout &lt;&lt; current &lt;&lt;endl;
          int j = i-1;
          while (j &gt;= 0 &amp;&amp; comp(current, a[j], reverse)) {
             a[j+1] = a[j]; //shift right
             j--;
          }
          a[j+1] = current;
      }
      show(a, size); //another function which prints all elements of a
  }
  </code></pre>
  <p>but if I change</p>
  <pre><code>    auto comp = [](int a, int b, bool reverse) {
  </code></pre>
  <p>with</p>
  <pre><code>    bool comp = [](int a, int b, bool reverse) {
  </code></pre>
  <p>GCC compiler throws following error while compiling
  <code> error: 'comp' cannot be used as a function 29 |   while (j &gt;= 0 &amp;&amp; comp(current, a[j], reverse)) {</code></p>
  <p>So is this expected? What is general rule? Shall I always specify return type as <code>auto</code>?</p>