title: identifier 'sort' is undefined c++
body: <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;limits&gt;
  #include &lt;sstream&gt;
  #include &lt;numeric&gt;
  #include &lt;ctime&gt;
  #include &lt;cmath&gt;
  #include &lt;vector&gt;
  #include &lt;cstdlib&gt;
  
  using namespace std;
  
  vector&lt;int&gt; randVect(int amount, int min, int max);
  
  int main(int argc, char** argv) 
  {
  
  vector&lt;int&gt; values = randVect(10, 1, 50);
  
  sort(values.begin(), values.end(), [](int x, int y){return x &lt; y;});
  for (auto val: values){
      cout &lt;&lt; val &lt;&lt; endl;
  }
  
  return 0;
  };
  
  
  vector&lt;int&gt; randVect(int amount, int min, int max){
      vector&lt;int&gt; vecVals;
      srand(time(NULL));
      int i = 0, randVal = 0;
      while(i &lt; amount){
          randVal = min + rand() % ((max + 1) - min);
          vecVals.push_back(randVal);
          i++;
      }
      return vecVals;
  }
  </code></pre>
  <p>// I am trying to sort random values that is located in a vector and for that i have to use the sort() function but it is telling me that identifier 'sort' undefined... how can i fix this?</p>