title: no matching function for call to sort()
body: <p>I'm teaching myself through Programming: Principles and Practice Using C++ (2nd Edition) and I'm at the vectors section. I can copy and paste their code and it still won't work. My code is as follows.</p>
  
  <pre><code>#include "iostream"
  #include "vector"
  #include "algorithm"
  
  
  
  using namespace std;
  
  
  int main()
  {
      cout &lt;&lt; "Please enter the temperatures for the last five days\n";
      vector&lt;double&gt; temperatures;
  
      for(double temp; cin &gt;&gt; temp;){
          temperatures.push_back(temp);
      }
      double sum = 0;
      for (double temp : temperatures){
          sum += temp;
      }
      cout &lt;&lt; "Mean temperature is " &lt;&lt;(sum / temperatures.size()) &lt;&lt; endl;
  
      sort(temperatures);
      cout &lt;&lt; "Median temperature is " &lt;&lt; temperatures[temperatures.size()/2];
  }
  </code></pre>
  
  <p>Help is appreciated and an explanation is better.</p>