Prepare for the v1.17 release cycle.

This commit is contained in:
Ernie Pasveer
2023-04-09 12:01:10 -05:00
parent a4290ffa8f
commit 697bba1d4c
8 changed files with 56 additions and 3 deletions
+28
View File
@@ -0,0 +1,28 @@
#include <iostream>
#include <stdexcept>
int AddPositiveIntegers (int a, int b) {
if (a < 0 || b < 0) {
throw std::invalid_argument("AddPositiveIntegers arguments must be positive");
}
return a + b;
}
int main() {
try {
std::cout << AddPositiveIntegers(-1, 2); //exception
} catch (std::invalid_argument& e) {
std::cerr << e.what() << std::endl;
return -1;
}
return 0;
}