36{
38
40
41 try {
42
43 JParser<> zap(
"Example program to test mutex messaging.");
44
46
47 zap(argc, argv);
48 }
49 catch(const exception &error) {
50 FATAL(error.what() << endl);
51 }
52
54 int credit_card = 0;
55
56 cout << "Trying to deposit 1000 eur\n";
57
58 {
61 }
62
63 cout << "Trying to put a negative amount\n";
64
65 try {
68 } catch (runtime_error const& e) {
69 cout << e.what() << '\n';
70 }
71
72 cout << "Let the wife do shopping\n";
73
74 try {
75 while (credit_card) {
77
78 int const cost = rand() % 100;
79 cout << "Paying " << cost << "for something\n";
81 }
82 } catch (runtime_error const& e) {
83 cout << e.what() << '\n';
84 }
85}
void withdraw(int &account, int amount)
void deposit(int &account, int amount)
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.