source: doc/theses/andrew_beach_MMath/code/cross-catch.cpp @ 55ad35c

ADTast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 55ad35c was ea593a3, checked in by Andrew Beach <ajbeach@…>, 3 years ago

First draft of all the exception benchmarks. There is an issue with the Cforall linking.

  • Property mode set to 100644
File size: 400 bytes
Line 
1// Cross a Try Statement with a Termination Handler
2#include <exception>
3#include <cstdlib>
4
5struct NotRaisedException : public std::exception {};
6
7int main(int argc, char * argv[]) {
8        unsigned int times = 1;
9        if (2 < argc) {
10                times = strtol(argv[1], nullptr, 10);
11        }
12
13        for (unsigned int count = 0 ; count < times ; ++count) {
14                try {
15                        // ...
16                } catch (NotRaisedException &) {
17                        // ...
18                }
19        }
20}
Note: See TracBrowser for help on using the repository browser.