I have some technical questions. In this function:
string report() const {
if(list.begin() == list.end()){
throw "not good";
}
//do something
}
If I throw the exception what is going on with the program? Will my function terminate or will it run further? If it terminates, what value will it return?
If you throw an exception, all functions will be exited back to the point where it finds a
try...catchblock with a matchingcatchtype. If your function isn’t called from within a try block, the program will exit with an unhandled exception.Check out https://isocpp.org/wiki/faq/exceptions for more info.