Skip to content

Instantly share code, notes, and snippets.

@zwily
Created October 14, 2009 17:54
Show Gist options
  • Save zwily/210258 to your computer and use it in GitHub Desktop.
Save zwily/210258 to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#include <iostream>
class A {
public:
A() {
std::cout << "A ctor" << std::endl;
}
~A() {
std::cout << "A dtor" << std::endl;
}
};
int main(int argc, char *argv[]) {
bool done = false;
label:
{
A a;
if (!done) {
done = true;
goto label;
}
}
std::cout << "done" << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment