I want to use std::stoi. Although I could use ::atoi(str.c_str()) it would make the code cleaner if this would work. But Eclipse tells me:
Function 'stoi' could not be resolved
I checked that
- the header
<string>is included, - include paths are set correctly, as I can use
std::string, - the compiler flag
-std=c++0x -std=c++11is set too.
Is stoi() missing in gcc, or is it somehow my fault?
I am using gcc (Debian 4.7.2-4) 4.7.2.
-std=c++0x?-std=c++11. Can't imagine that would cause this bug though. (Also, just to confirm, you are either usingstd::stoior pulling in the std namespace?) Wait.... Will it compile? Like Nikos C. said below, it might just be Eclipse complaining.