title: VS code showing error in c++ code which is working absolutely fine on online compilers and Xcode
body: <p>I have written a C++ code to sort out a vector of objects. When i pass a lamda function as the third argument to the sort function for sorting the objects, it shows an error on vs code saying,&quot;expression expected&quot; pointing to the starting of the third argument. this exact code works fine on online compilers and Xcode.</p>
  <pre><code>
  #include&lt;iostream&gt;
  #include&lt;vector&gt;
  #include&lt;algorithm&gt;
  using namespace std;
  
  class Process
  {
      public:
      int AT,BT,CT,TAT,WT;
      Process(int AT,int BT)
      {
          this-&gt;AT=AT;
          this-&gt;BT=BT;
          CT=0;
          TAT=0;
          WT=0;
      }
  };
  
  
  
  // bool comaprator(Process p1, Process p2)
  // {
  //     return p1.AT&lt;p2.AT;
  // }
  
  
  bool comparor(Process p1, Process p2)
  {
      return p1.AT&lt;p2.AT;
  }
  
  class Scheduler
  {
      int clock;
      vector&lt;Process&gt; pr;
      public:
      Scheduler(vector&lt;Process&gt; v)
      {
          pr=v;
          clock=0;
      }
      void printFcfsStats()
      {
          clock=0;
          sort(pr.begin(),pr.end(),[](Process p1, Process p2) -&gt; bool{return p1.AT&lt;p2.AT;} );
          
          //sort(pr.begin(),pr.end(),[](Process p1, Process p2) -&gt; bool{return p1.AT&lt;p2.AT;} );
          for(int i=0;i&lt;pr.size();i++)
          {
              cout&lt;&lt;pr[i].AT&lt;&lt;&quot;\n&quot;;
          }
  
      }
  
  };
  
  vector&lt;Process&gt; processCreator()
  {
      cout&lt;&lt;&quot;Enter the number of processes\n&quot;;
      vector&lt;Process&gt; pr;
      int nop;
      cin&gt;&gt;nop;
      for(int a=0;a&lt;nop;a++)
      {
          cout&lt;&lt;&quot;Enter the arrival time of procees &quot;&lt;&lt;(a+1)&lt;&lt;&quot;\n&quot;;
          int AT;
          cin&gt;&gt;AT;
          cout&lt;&lt;&quot;Enter the burst time of procees &quot;&lt;&lt;(a+1)&lt;&lt;&quot;\n&quot;;
          int BT;
          cin&gt;&gt;BT;
          Process p(AT,BT);
          pr.push_back(p);
      }
      return pr;
  }
  
  int main()
  {
      vector&lt;Process&gt; v;
      Scheduler obj(processCreator());
      
      obj.printFcfsStats();
      
  }
  
  </code></pre>
  <p>I have tried deleting VS code completely (including the hidden files) and reinstalling it. The compiler that I am using is clang++.</p>
  <p>images: <a href="https://drive.google.com/file/d/18cXn86lnJjtwlAvKNSylKRgIywJBZKU1/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/18cXn86lnJjtwlAvKNSylKRgIywJBZKU1/view?usp=sharing</a>
  <a href="https://drive.google.com/file/d/1wS-Nv2lGoDoF7jvMmdtGByx_cKTZi318/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1wS-Nv2lGoDoF7jvMmdtGByx_cKTZi318/view?usp=sharing</a></p>