title: 'stoi' was not declared in this scope still apperaing even adding -std=c++0x and custom function
body: <p>I am having problems using atoi, I tried adding <code>-std=c++0x</code>  and also tried to change atoi function with from_string</p>
  
  <pre><code>template &lt;typename T&gt; from_string(std::string const &amp; s) {
      std::stringstream ss(s);
      T result;
      ss &gt;&gt; result;    // TODO handle errors
      return result;
  }
  </code></pre>
  
  <p>but when using this I am getting</p>
  
  <pre><code>C:\Users\Eua\Desktop\cours\main.cpp|382|error: ISO C++ forbids declaration of 'from_string' with no type [-fpermissive]|
  C:\Users\Eua\Desktop\cours\main.cpp|392|error: no matching function for call to 'from_string(std::basic_string&lt;char&gt;)'|
  C:\Users\Eua\Desktop\cours\main.cpp|392|note: candidate is:|
  C:\Users\Eua\Desktop\cours\main.cpp|382|note: template&lt;class T&gt; int from_string(const string&amp;)|
  C:\Users\Eua\Desktop\cours\main.cpp|382|note:   template argument deduction/substitution failed:|
  C:\Users\Eua\Desktop\cours\main.cpp|392|note:   couldn't deduce template parameter 'T'|
  C:\Users\Eua\Desktop\cours\main.cpp|392|error: no matching function for call to 'from_string(std::basic_string&lt;char&gt;)'|
  C:\Users\Eua\Desktop\cours\main.cpp|392|note: candidate is:|
  C:\Users\Eua\Desktop\cours\main.cpp|382|note: template&lt;class T&gt; int from_string(const string&amp;)|
  C:\Users\Eua\Desktop\cours\main.cpp|382|note:   template argument deduction/substitution failed:|
  C:\Users\Eua\Desktop\cours\main.cpp|392|note:   couldn't deduce template parameter 'T'|
  ||=== Build failed: 3 error(s), 1 warning(s) (0 minute(s), 2 second(s)) ===|
  </code></pre>
  
  <p>How can I solve the issue?</p>