werehuman 01.08.2011 12:06 Psi+

Question: Why does lexical_cast<int8_t>("127") throw bad_lexical_cast?
Answer: The type int8_t is a typedef to char or signed char. Lexical conversion to these types is simply reading a byte from source but since the source has more than one byte, the exception is thrown. Please use other integer types such as int or short int. If bounds checking is important, you can also call numeric_cast:

1. mva 01.08.2011 12:12 N900

я может что-то путаю, но 127 вроде как помещается даже в сигнед чар

2. werehumanmva /1 01.08.2011 12:13 Psi+

хехехе, "127" воспринимается как массив из трёх char

3. mvawerehuman /2 01.08.2011 12:14 N900

а :)

Do you really want to delete ?