Can a variable parameter reorder the compiler and throw()op in C ++? Or, does standard C ++ 14882-1998 enable or disable the compiler of this conversion?
For code:
bool funct()
{
bool succeeded = false;
bool res_throw = false;
try {
throw("it");
succeeded = true;
}
catch(...) {
res_throw = true;
}
cout << "Result of throw: " << res_throw << endl;
cout << "succeeded: " << succeeded << endl;
return succeeded;
}
Could there be a way out
Result of throw: true
succeeded: true
The standard says: "[intro.execution] # 7":
object change .. all side effects that are changes to the state of the runtime
At certain specific points in the execution sequence, called sequence points, all side effects of previous evaluations should be complete and no side effects of subsequent evaluations should be
Is a throwsequence point expression?
source
share