#include <stdio.h>
struct ex {
ex(int x) : random_data(x) {}
int random_data;
};
ex current_ex()
{
try {
throw;
} catch(ex& f) {
return f;
} catch(...) {
return ex(600);
}
}
void foo() {
for(unsigned i = 0; i < 300; ++i) {
try {
throw ex(42);
} catch(...) {
ex x = current_ex();
printf("%d ", x.random_data);
}
}
printf("\n");
}
int main() {
foo();
}