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

@@ -193,6 +193,7 @@ BOOST_AUTO_TEST_CASE(Addition)
#include <iostream>
int main()
try
{
typedef AutoDiff::ForwardBlock<double> ADB;
std::vector<int> blocksizes = { 3, 1, 2 };
@@ -233,4 +234,8 @@ int main()
m.insert(1,1) = 1;
std::cout << m*sqx;
}
catch (const std::exception &e) {
std::cerr << "Program threw an exception: " << e.what() << "\n";
throw;
}
#endif