Hi to all =)
I’ve a little curiosity
If I’ve the following function, that close the program calling sys.exit:
void stop(int state){
std::exit(state);
}
Now, I want to call this function, but without exit the program.
So, I want to “catch” the std::exit command… is there a method to do it?
Do the same as with tail recursion: Have the offending function call always be the last statement in the execution path, or not occur at all:
This function will never do anything after calling
std::exit, but might also not call it at all, decided after evaluating whatever you want in another function, for example.