I am learning C++ exceptions and I would like some clarification of the scenario:
T function() throw(std::exception);
...
T t = value;
try { t = function(); }
catch (...) {}
if the exception is thrown, what is the state of variable t?
unchanged or undefined?
Unchanged.
tcan’t be assigned untilfunction()returns a value, andfunction()never returns normally