// Code derived from Stroustrup's PPP2 book// § 5.10 Pre- and post-conditions// -and beginning on p 164#include<iostream>#include<stdexcept>usingstd::cerr;usingstd::cout;usingstd::exception;usingstd::runtime_error;voiderror(constchar*s){throwruntime_error(s);}// the arguments are positive and a < b < cintmy_complicated_function(inta,intb,intc){if(!(0<a&&a<b&&b<c))// ! means “not” and && means “and”error("bad arguments for mcf");// . . .return1;// stub}intmain()try{intx=my_complicated_function(1,2,"horsefeathers");cout<<x<<'\n';}catch(exception&e){cerr<<"error: "<<e.what()<<'\n';// keep_window_open();return1;}catch(...){cerr<<"Oops: unknown exception!\n";// keep_window_open();return2;}