title: no known conversion for argument 1 from 'int' to 'gnu_cxx::normal_iterator<int*, std::vector<int>>&&'. I'm unable to find a way to get my code working
body: <p>I am trying to carry out a binary search to find the index of a specific element within the vector. I tried getting the first and last element and passing them to the variable high and low. I am getting some sort of conversion error. The error is below inside the BinarySearchVector funtion.</p>
  <pre><code>
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  
  using namespace std;
  
      int limit=10;
      vector &lt;int&gt; elements; 
      void AddValueToVector(){
          cout&lt;&lt;&quot;Hello World:&quot;&lt;&lt;endl;
          for (int i = 0; i &lt; limit; i++)
          {
              int a;
              cin&gt;&gt;a;
              elements.push_back(a);
          }   
          
      }
      void printContents(){
          cout&lt;&lt;&quot;Vector elements:&quot;&lt;&lt;endl;
          for (int j = 0; j &lt; limit; j++)
          {
              cout&lt;&lt;elements[j]&lt;&lt;endl;
          }   
      }
  
      int binarySearchVector(vector&lt;int&gt;&amp;elements,int searchval){
          sort(elements.begin(),elements.end());
  
          auto low= elements.begin();
          auto high= elements.end();
           while (low &lt;= high) {
              int mid = low + (high - low) / 2;
  
              if (elements[mid] == searchval)
              return mid;
  
              if (elements[mid] &lt; searchval)
              low = mid + 1;
  
              else
              high = mid - 1;
          }
          return -1;     
      }
  
      void search(){
          int searchval;
          cout&lt;&lt;&quot;Enter value to search:&quot;&lt;&lt;endl;
          cin&gt;&gt;searchval;
          int result= binarySearchVector(elements,searchval);
          if (result==-1)
          {
              cout&lt;&lt;&quot;Not Found&quot;&lt;&lt;endl;
          }else{
              cout&lt;&lt;&quot;Element is found at index&quot;&lt;&lt;result&lt;&lt;endl;
          }
          
      }
   
  int main()
  {
      AddValueToVector();
      printContents();
      search();
      return 0;
  }
  
  
  </code></pre>
  <p>Any recommendations will be greatly appreciated.</p>