| 1 | #include <iostream> |
| 2 | #include <stdexcept> |
| 3 | #include <string> |
| 4 | #include <vector> |
| 5 | |
| 6 | int main() |
| 7 | { |
| 8 | const std::vector<int> values{2, 3, 5}; |
| 9 | try { |
| 10 | (void)values.at(values.size()); |
| 11 | } catch (const std::out_of_range& error) { |
| 12 | if (std::string(error.what()).empty()) |
| 13 | return 1; |
| 14 | std::cout << "Vinix C++ exception handling passed\n"; |
| 15 | return 0; |
| 16 | } |
| 17 | return 1; |
| 18 | } |
| 19 |