title: Compile error: 'stoi' is not a member of 'std'
body: <p>My code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  int main()
  {
      std::string test = "45";
      int myint = std::stoi(test);
      std::cout &lt;&lt; myint &lt;&lt; '\n';
  }
  </code></pre>
  
  <p>Gives me the compile error:</p>
  
  <pre><code>error: 'stoi' is not a member of 'std'
       int myint = std::stoi(test);
                   ^
  </code></pre>
  
  <p>However, according to <a href="https://stackoverflow.com/questions/13589947/how-to-use-c11-stdstoi-with-gcc">here</a>, this code should compile fine. I am using the line <code>set(CMAKE_CXX_FLAGS "-std=c++11 -O3")</code> in my <code>CMakeLists.txt</code> file.</p>
  
  <p>Why is it not compiling?</p>
  
  <hr>
  
  <p>Update: I am using <code>gcc</code>, and running <code>gcc --version</code> prints out:</p>
  
  <pre><code>gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
  </code></pre>