| 696 | |
| 697 | |
| 698 | bool str2int( |
| 699 | const string& text, |
| 700 | int& res) |
| 701 | { |
| 702 | int i; |
| 703 | size_t Pos; |
| 704 | try |
| 705 | { |
| 706 | i = stoi(text, &Pos); |
| 707 | if (Pos != text.size()) |
| 708 | return false; |
| 709 | |
| 710 | } |
| 711 | catch ([[maybe_unused]] const invalid_argument& ia) |
| 712 | { |
| 713 | return false; |
| 714 | } |
| 715 | catch ([[maybe_unused]] const out_of_range& ia) |
| 716 | { |
| 717 | return false; |
| 718 | } |
| 719 | |
| 720 | res = i; |
| 721 | return true; |
| 722 | } |
| 723 |
no outgoing calls
no test coverage detected