diff options
Diffstat (limited to 'support/ToolchainSupport.h')
-rw-r--r-- | support/ToolchainSupport.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/support/ToolchainSupport.h b/support/ToolchainSupport.h index 03bbff9aba..b4ed2fa9a4 100644 --- a/support/ToolchainSupport.h +++ b/support/ToolchainSupport.h @@ -71,6 +71,17 @@ inline int stoi(const std::string &str, std::size_t *pos = 0, NumericBase base = } ss << str; ss >> x; + + if(pos) + { + std::string s; + std::stringstream ss_p; + + ss_p << x; + ss_p >> s; + *pos = s.length(); + } + return x; } @@ -96,6 +107,17 @@ inline unsigned long stoul(const std::string &str, std::size_t *pos = 0, Numeric } stream << str; stream >> value; + + if(pos) + { + std::string s; + std::stringstream ss_p; + + ss_p << value; + ss_p >> s; + *pos = s.length(); + } + return value; } |