title: ‘numeric_limits’ was not declared in this scope, no matching function for call to ‘max()’
body: <p>I compiled this code at home on my mac w/ xcode and there was no provblem. I compile it at school with g++ on linux and I get these errors:</p>
  <blockquote>
  <p>numeric_limits’ is not a member of std</p>
  <p>expected primary-expression before ‘&gt;’ token</p>
  <p>no matching function for call to ‘max()’</p>
  </blockquote>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  
  using namespace std;
  
  int GetIntegerInput(int lower, int upper)
  {
      int integer = -1;
      do
      {
          cin &gt;&gt; integer;
          cin.clear();
          cin.ignore(std::numeric_limits&lt;streamsize&gt;::max(), '\n');  //errors here
      } while (integer &lt; lower || integer &gt; upper);
  
      return integer;
  }
  </code></pre>
  <p>I'm guessing maybe I have to include an extra header. If I take away the <code>std::</code> it just gives me a similar error:</p>
  <p><code>numeric_limits</code> was not declared in this scope</p>