Add exception handlers to all tutorials and examples

This commit is contained in:
Andreas Lauser
2013-09-03 14:41:38 +02:00
parent a26483b51d
commit 51cb4f2cb8
12 changed files with 57 additions and 0 deletions

View File

@@ -41,6 +41,7 @@
int
main()
try
{
typedef AutoDiff::Forward<double> AdFW;
@@ -69,3 +70,8 @@ main()
std::cout << "a - 1: " << (a - 1) << '\n';
std::cout << "a - b: " << (a - b) << '\n';
}
catch (const std::exception &e) {
std::cerr << "Program threw an exception: " << e.what() << "\n";
throw;
}