istringstream to int8_t produce unexpected result
问题 After read this FAQ, i choose to use istringstream to convert my input string to numerical value. My code is look like this: <template T> T Operand<T>::getValue(const std::string &s) { T _value; std::istringstream v_ss(s); v_ss >> _value; return _value; } When T is int, short, long or float, no problem i get correct value. But when T is int8_t, this code doesn't work. By exemple, if my input string is "10", getValue return me a int8_t with value equals 49. With 49 == '1' in ASCII table, i