| int Chusov::String::stoi | ( | const ucp_string & | str, |
| std::size_t *restrict | pos = nullptr, |
||
| int | base = 10 |
||
| ) |
Converts a UCP string to int.
| str | A string to convert. | |
| [out] | pos | An optional buffer receiving the amount of characters successfully converted to int. |
| base | A base of the string representation of the integral number. |
The function behaves identically to the call
(where on output
, and the return valus is cast to int), but instead of returning an error code the function throws as follows.
| std::invalid_argument | The input string does not match a pattern of an integral number. |
| std::out_of_range | The result of conversion has caused an integral overflow. |
The function behaves like std::stoi does for the char characters but accepts ucp_t characters instead.