Lower-level library function which throws exceptions.
| 19 | |
| 20 | // Lower-level library function which throws exceptions. |
| 21 | int compute_answer_throws() |
| 22 | { |
| 23 | switch( rand()%4 ) |
| 24 | { |
| 25 | default: return 42; |
| 26 | case 1: throw error_a(); |
| 27 | case 2: throw error_b(); |
| 28 | case 3: throw error_c(); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | |
| 33 | // Call compute_answer_throws, switch to result<int> for error handling. |
no test coverage detected