Lame Segfault.
#include <exception>
using namespace std;
struct Ball : public exception {
};
struct P {
P* target;
void aim(const Ball& ball) {
try {
throw ball;
}
catch(Ball& ball) {
target->aim(ball);
}
}
};
int main() {
P parent;
P child{&parent};
parent.target = &child;
parent.aim(Ball());
}