Bonding

I read this today and thought it was cute:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class Ball : Throwable {};

class P {
public:
  P* Target;

  P () {}
  P (P* target) {
    this->Target = target;
  }

  void Aim(Ball ball) {
    try {
      throw ball;
    }
    catch(Ball b) {
      Target->Aim(b);
    }
  }
};

int main() {
  P Parent;
  P Child( &Parent );
  Parent.Target = &Child;
  Parent.Aim( Ball() );
}

http://xkcd.com/1188/
Last edited on
Infinite recursion. Stack overflow.
I love xkcd.
Xkcd is inconsistent. Sometimes it's excellent, but sometimes it's terrible. SMBC is consistently awesome, I highly recommend it.
I like how it passes the ball temp by value so C++11 move constructors are used XD
@ Disch
The stack overflow represents the child's bordome with the game of catch and desire to inspect the grass. All of this happens while the parent is trying to throw the ball and ends up pegging the child in the head, thereby knocking it unconscious.
Topic archived. No new replies allowed.