Suppose that I have the following code:
void foo() {
{
myclass object;
object.do_something();
}
cout<<"hello"<<endl;
}
Is ~myclass()
guaranteed to be called by the time the local scope is exited, or might it be called at a later time (such as when the function returns)?