Hacker News new | ask | show | jobs
by pyrtsa 4665 days ago
Nitpick:

    if (x < 100) throw new Exception("Weird!); // LEAK!
You shouldn't use `new` either when throwing exceptions. Just:

    if (x < 100) throw Exception("Weird!); // no leak.
1 comments

The grandparent's code is Java, not C++.